Hi,

Friday, October 3, 2003, 3:51:59 PM, you wrote:
CP> Im trying to retrieve the unsigned value of an integer. sounds pretty simple...

CP> [code]
CP> $i = -86;
CP> echo "<br>" . sprintf("%d", $i);
CP> echo "<br>" . sprintf("%u", $i);
CP> [/code]

CP> produces:
CP> -86
CP> 4294967198

CP> what i expected:
CP> -86
CP> 86

CP> Ive searched the archives but most of the messages refer to %s or %d... nothing in 
regards to %u

CP> can anyone see what im doing wrong?

CP> Im using PHP 4.3.2

CP> TIA

CP> Cody


CP> 
*************************************************************************************
CP> This e-mail, including any attachments to it, may contain confidential and/or 
personal information.
CP> If you have received this e-mail in error, you must not copy,
CP> distribute, or disclose it, use or take any action 
CP> based on the information contained within it.

CP> Please notify the sender immediately by return e-mail of the error and then delete 
the original e-mail.

CP> The information contained within this e-mail may be solely the opinion
CP> of the sender and may not necessarily 
CP> reflect the position, beliefs or opinions of Salmat on any issue.

CP> This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

CP> For more information, visit our website at  www.salmat.com.au.
CP> 
*************************************************************************************

CP> --
CP> PHP General Mailing List (http://www.php.net/)
CP> To unsubscribe, visit: http://www.php.net/unsub.php


-86 actually looks like FFFFFFAA which if you then look at unsigned is pretty
big :)

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to