• 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: Problem with NSDecimalNumber truncating zeros
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Problem with NSDecimalNumber truncating zeros (From: Eric Hermanson <email@hidden>)
 >Re: Problem with NSDecimalNumber truncating zeros (From: WT <email@hidden>)

  • Prev by Date: Re: Problem with NSDecimalNumber truncating zeros
  • Next by Date: Re: Cocoa System Requirements
  • Previous by thread: Re: Problem with NSDecimalNumber truncating zeros
  • Next by thread: Re: Problem with NSDecimalNumber truncating zeros
  • Index(es):
    • Date
    • Thread