• 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: Float behaviour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Float behaviour


  • Subject: Re: Float behaviour
  • From: Chris Kane <email@hidden>
  • Date: Tue, 23 Aug 2005 09:27:29 -0700

On Aug 22, 2005, at 6:40 PM, David Phillip Oster wrote:

At 11:24 AM -0700 8/22/05, ObjM2 <email@hidden>

You'll need a BCD library (BCD = binary coded decimals => no rounding
errors)
It shouldn't be all too difficult to write a Cocoa class for BCDs
though.


Already in Cocoa: NSDecimalNumber


Actually no. NSDecimalNumber is a floating point representation, with mantissa and exponent, just like doubles. It's just able to represent a larger range/more precision than what had been available natively from C-based languages and the compiler. "long double" -- available in gcc 4.0 -- is about the same precision and a much greater value range. Not to mention that any "native" compiler support is going to be a thousand times faster than doing arithmetic with NSDecimalNumber.


Chris Kane Cocoa Framework, Apple

_______________________________________________
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: 
 >Re: Float behaviour (From: David Phillip Oster <email@hidden>)

  • Prev by Date: Re: Code signing
  • Next by Date: Quick way to get contents of NSTableView as text?
  • Previous by thread: Re: Float behaviour
  • Next by thread: Re: [NSSearchField] Strange new localization log under Tiger (SOLVED)
  • Index(es):
    • Date
    • Thread