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

Re: inconsistent float behaviour


  • Subject: Re: inconsistent float behaviour
  • From: "Gary L. Wade" <email@hidden>
  • Date: Fri, 10 Oct 2008 13:11:28 -0400

I've not used it myself, but there is also NSDecimal that may be an alternative.  Also, I recall seeing an IBM-released class that I believe had been part of ICU that also did decimal arithmetic using 32 or 64 bits.

>
>On Oct 10, 2008, at 5:04 AM, Steven Hamilton wrote:
>
>> Am I totally misunderstanding something about floats? Or is the
>> extra ##'s in the formatter making things up?
>
>
>Floating point values of either float or double are not guaranteed to
>be super precise, and should never be used to represent currency
>values. Try using a long long instead, and have the first two digits
>represent a fractional unit of currency.
>
>Nick Zitzmann
><http://www.chronosnet.com/>
>
_______________________________________________

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

  • Prev by Date: Re: Strategy for naming support folder
  • Next by Date: Re: inconsistent float behaviour
  • Previous by thread: Re: inconsistent float behaviour
  • Next by thread: CATextLayers text alignment?
  • Index(es):
    • Date
    • Thread