• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: double cast to unsigned int gets different results on PPC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >double cast to unsigned int gets different results on PPC (From: David Alter <email@hidden>)

  • Prev by Date: Re: Suppressing warning
  • Next by Date: Re: Unable to debug custom executable
  • Previous by thread: Re: double cast to unsigned int gets different results on PPC
  • Next by thread: re: double cast to unsigned int gets different results on PPC
  • Index(es):
    • Date
    • Thread