Re: double cast to unsigned int gets different results on PPC
Re: double cast to unsigned int gets different results on PPC
- Subject: Re: double cast to unsigned int gets different results on PPC
- From: Jeffrey Oleander <email@hidden>
- Date: Thu, 17 Apr 2008 22:44:22 -0700 (PDT)
> David Alter <email@hidden> wrote:
> I have a double that is assigned a negative value. I get
> different
> results if it is cast to an unsigned int depending on if
> I'm on PPC or
> Intel. The PPC values look correct.
>
> Here is the code for may test
>
> double val = -1;
> printf ( "unsigned long long=%llu \n", (unsigned long
> long)val );
> printf ( "unsigned=%u \n\n", (unsigned int)val );
>
>
> Here is the results on PPC
> unsigned long long=4294967295
> unsigned=4294967295
2^32 - 1
> Here is the results on Intel
> unsigned long long=18446744073709551615
> unsigned=0
2^64 - 1
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden