• 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: @sum and BigDecimal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @sum and BigDecimal


  • Subject: Re: @sum and BigDecimal
  • From: Francis Labrie <email@hidden>
  • Date: Mon, 12 Mar 2007 08:24:24 -0400

Hi Mike,

Mike Schrag wrote:
It looks like @sum doesn't properly propagate BigDecimal scale and rounding modes ... I'm guessing somewhere in the code path it turns the big decimal into a double or float (which is a terrible no- no). Just a heads up in case you're using @sum for anything where scale and rounding mode are important.


The problem lies in _NSUtilities.convertNumberIntoCompatibleValue (Number, Class) method, and not in the @sum operator itself: if you use a Number subclass that is not exactly an Integer, Long, Short, Byte, BigInteger or BigDecimal, it build up a new BigDecimal instance using the doubleValue() Number method... :-(


--
Francis Labrie, Architecte de systèmes, OS communications informatiques - Votre moteur de communication
email@hidden | Téléphone : (450) 676-1238, poste 27 | Télécopieur : (450) 676-5276


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: @sum and BigDecimal
      • From: Mike Schrag <email@hidden>
References: 
 >@sum and BigDecimal (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Create and Query Multiple Values in an attribute
  • Next by Date: Re: Ajax Updates
  • Previous by thread: @sum and BigDecimal
  • Next by thread: Re: @sum and BigDecimal
  • Index(es):
    • Date
    • Thread