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: Scott Anguish <email@hidden>
- Date: Tue, 28 Mar 2006 15:35:34 -0800
On Mar 28, 2006, at 3:29 PM, Derrick Bass wrote:
"NSDecimalNumber, an immutable subclass of NSNumber, provides an
object-oriented wrapper for doing ***base-10 arithmetic***. An
instance can represent ***any number that can be expressed as
mantissa x 10^exponent*** where mantissa is a decimal integer up to
38 digits long, and exponent is an integer from –128 through 127."
I've added highlighting to the appropriate parts. Yes, it's a
floating point representation, just like Chris said, but it's a
BASE-10 floating point representation, not base-2 like the native C-
types. Chris's post was unclear on this; he never directly said it
wasn't base-10, but he did imply it by contradicting what a
previous poster had said. For reference again, he said:
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.
Chris has the high-trump apple.com email address, but even so I
don't think his quote is clear enough that we should simply
disregard the documentation, unless he's willing to explicitly
disavow it.
Folks
If there is a documentation bug here, or even if it isn't clear,
then please file a bug.
_______________________________________________
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