Re: 1.0 divided by 10 = 0.10000000000000001?
Re: 1.0 divided by 10 = 0.10000000000000001?
- Subject: Re: 1.0 divided by 10 = 0.10000000000000001?
- From: Derrick Bass <email@hidden>
- Date: Mon, 27 Mar 2006 19:44:06 -0600
On Mar 27, 2006, at 4:53 PM, Marcel Weiher wrote:
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.
Yes, true. It wasn't exactly clear what the OP needed, but it
appeared that the real problem might be needing exact representation
of base-10 numbers, rather than precision problems. If so, the
NSDecimalNumber is exactly what's needed.
Derrick
_______________________________________________
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