Re: Problem with NSDecimalNumber truncating zeros
Re: Problem with NSDecimalNumber truncating zeros
- Subject: Re: Problem with NSDecimalNumber truncating zeros
- From: Michael Ash <email@hidden>
- Date: Mon, 6 Jul 2009 22:55:12 -0400
On Mon, Jul 6, 2009 at 10:04 PM, WT<email@hidden> wrote:
> On Jul 6, 2009, at 10:52 PM, Fritz Anderson wrote:
>
>> NSDecimalNumber just keeps numerical values, not their history. If two
>> numbers, _as numbers_, are equal, you should expect the normalized internal
>> representations to be identical. 22.00 == 22 .
>>
>> If you need to preserve context, you'll have to keep it yourself in
>> another data structure (possibly one that wraps an NSDecimalNumber).
>
> NSDecimalNumbers would be useless, if that were true. The whole point of
> having NSDecimalNumbers is to be able to preserve precision.
According to the documentation, the whole point of having
NSDecimalNumbers is to do base-10 arithmetic. I see nothing in there
about preserving precision, neither in reference to the design intent
nor in reference to the implementation. Perhaps I missed something?
Times like this I wonder if I am the only one who consults
documentation before posting....
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden