• 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: Mike Schrag <email@hidden>
  • Date: Mon, 12 Mar 2007 09:18:40 -0400

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... :-(
You mention that if you don't use a subclass that is (among others) BigDecimal it does this ... It appears as I'm looking at this (well, it WOULD appear if I looked at decompiled code, which I've stated before, of course I don't do) that it does this specifically IF you use a subclass that is BigDecimal. It seems to me that there's a crucial check missing that if newValueType.isAssignableFrom (value.getClass()) then it should just return the original value without all the other fuss, which would deal w/ the case where you ask to turn a BigDecimal into a BigDecimal.

ms



_______________________________________________
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


References: 
 >@sum and BigDecimal (From: Mike Schrag <email@hidden>)
 >Re: @sum and BigDecimal (From: Francis Labrie <email@hidden>)

  • Prev by Date: Re: Ajax Updates
  • Next by Date: Re: Ajax Updates
  • Previous by thread: Re: @sum and BigDecimal
  • Next by thread: WO 5.3 on Mac OS X 10.3 server?
  • Index(es):
    • Date
    • Thread