Re: @sum and BigDecimal
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