Re: [PHP] unexpected results using sprintf() with %u

2003-10-03 Thread David Otton
On Fri, 3 Oct 2003 15:51:59 +1000, you wrote: >Im trying to retrieve the unsigned value of an integer. sounds pretty simple... > >[code] >$i = -86; >echo "" . sprintf("%d", $i); >echo "" . sprintf("%u", $i); >[/code] > >produces: >-86 >4294967198 > >what i expected: >-86 >86 > >Ive searched the ar

Re: [PHP] unexpected results using sprintf() with %u

2003-10-02 Thread Curt Zirzow
* Thus wrote Cody Phanekham ([EMAIL PROTECTED]): > Im trying to retrieve the unsigned value of an integer. sounds pretty simple... > > [code] > $i = -86; > echo "" . sprintf("%d", $i); > echo "" . sprintf("%u", $i); > [/code] > > produces: > -86 > 4294967198 > > what i expected: > -86 > 86 > >

Re[4]: [PHP] unexpected results using sprintf() with %u

2003-10-02 Thread Tom Rogers
s [mailto:[EMAIL PROTECTED] >> Sent: Friday, 3 October 2003 16:27 >> To: Tom Rogers >> Cc: Cody Phanekham; [EMAIL PROTECTED] >> Subject: Re[2]: [PHP] unexpected results using sprintf() with %u >> >> >> Hi, >> >> TR> -86 actually looks lik

RE: Re[2]: [PHP] unexpected results using sprintf() with %u

2003-10-02 Thread Cody Phanekham
Rogers > Cc: Cody Phanekham; [EMAIL PROTECTED] > Subject: Re[2]: [PHP] unexpected results using sprintf() with %u > > > Hi, > > TR> -86 actually looks like FFAA which if you then look > at unsigned is pretty > TR> big :) > > TR> -- > TR> regard

Re[2]: [PHP] unexpected results using sprintf() with %u

2003-10-02 Thread Tom Rogers
Hi, TR> -86 actually looks like FFAA which if you then look at unsigned is pretty TR> big :) TR> -- TR> regards, TR> Tom Maybe what you need is the abs() function which ignores the sign of a number -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] unexpected results using sprintf() with %u

2003-10-02 Thread Tom Rogers
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 "" . sprintf("%d", $i); CP> echo "" . sprintf("%u", $i); CP> [/code] CP> produces: CP> -86 CP> 4294967198 CP> what i expected

[PHP] unexpected results using sprintf() with %u

2003-10-02 Thread Cody Phanekham
Im trying to retrieve the unsigned value of an integer. sounds pretty simple... [code] $i = -86; echo "" . sprintf("%d", $i); echo "" . sprintf("%u", $i); [/code] produces: -86 4294967198 what i expected: -86 86 Ive searched the archives but most of the messages refer to %s or %d... nothing in