• 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: encoding a NSDecimalNumber as IEEE-754 on an intel mac
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: encoding a NSDecimalNumber as IEEE-754 on an intel mac


  • Subject: Re: encoding a NSDecimalNumber as IEEE-754 on an intel mac
  • From: Tore Halset <email@hidden>
  • Date: Mon, 09 Oct 2006 22:14:06 +0200

On Oct 9, 2006, at 19:59, Tore Halset wrote:

On Oct 9, 2006, at 09:26, Hidetomo Katsura wrote:

do this instead:

double aDouble = [.... doubleValue];
CFSwappedFloat64 bigEndian = CFConvertFloat64HostToSwapped(aDouble);
[callData appendBytes:&bigEndian length:sizeof(bigEndian)];

// note: CFConvertFloat64HostToSwapped() is actually HostToBig().

Thanks. This seem to fix the endian problem, but it still does not work on an intel mac. "12.25" on the intel client are decoded as 8.6469112845513523E17 on the server. Perhaps intel does not use IEEE-754 to store their doubles?

Sorry, my mistake. I added the new line, but did not remove EndianS64_NtoB. Errrr.


Thanks Hidetomo for very good help!

 - Tore.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >encoding a NSDecimalNumber as IEEE-754 on an intel mac (From: Tore Halset <email@hidden>)
 >Re: encoding a NSDecimalNumber as IEEE-754 on an intel mac (From: Hidetomo Katsura <email@hidden>)
 >Re: encoding a NSDecimalNumber as IEEE-754 on an intel mac (From: Tore Halset <email@hidden>)

  • Prev by Date: CoreData & temporary oid (REPOST)
  • Next by Date: Re: Re: Re: NSCalendarDate saving and loading to get the same date-time
  • Previous by thread: Re: encoding a NSDecimalNumber as IEEE-754 on an intel mac
  • Next by thread: Re: More Mighty Mouse
  • Index(es):
    • Date
    • Thread