BigDecimal is a necessary evil, isn’t it. Without it, you end up over-running primitive bounds and suddenly your results are weird “what is with the negative numbers?”.
I was talking with someone whose “users” are uber-intense actuaries.
They need to be able to write quick reports, and change functionality on the fly.
Rather than using full on Java, they interfaced via a scripting language, to give them concise scripts versus the verbosity that we know and love from Java :)
JavaScript was one choice, but they quickly ran into problems with double/float/int/BigDecimal, and they had to manually do a lot of work with BigDeminal objects and methods.
Then along came Groovy, which automatically groks the fact that it should take care of autogrowing the world.
E.g.
def x = 10; println x.class; (1.0..100.0).step(20) { y -> println x; x = x * y; } println x.class;
Output
class java.lang.Integer 10 10.0 210.00 8610.000 525210.0000 class java.math.BigDecimal
Note the auto change, and how operators such as * / – + all JUST WORK.
August 2nd, 2005 at 5:17 am
Yeah, looks nice. But then again – what happens if you’d try to use Math.sin() or a Math.sqrt(). These aren’t defined for BigInteger. Wouldn’t your script crash with a ClassCastException (or something like that) if your int suddently changes int a BigInteger? After all *this* is the most painful stuff that you have to deal with, when using BigInteger, not simple artithmetics.
March 1st, 2006 at 1:01 pm
Simple math gets pretty painful with BigDecimal.
Simple math gets pretty painful with BigDecimal.
Simple interpolation in Groovy looks like it did in high school:
(lowerValue*(upperBound-value) + upperValue*(value-lowerBound)) / (upperBound-lowerBound)
In Java (I think?):
lowerValue.multiply(upperBound.subtract(value)).add(upperValue.multiply(value.subtract(lowerBound))).divide(upperBound.subtract(lowerBound), 10, BigDecimal.ROUND_HALF_UP);
October 24th, 2006 at 3:21 pm
I think this topic is very different and should be more pages like this,Your
comment says a lot of truth, it’s very actually, and I’d like to invited you
to visit my page:10/325-
Vicoprofen – Lortab- Tylenol
#3- Ativan
All Major Medications are available right here at: http://www.crdrx.com
February 16th, 2007 at 1:14 pm
See you…Thanks, its great to receive such positive comments.
tylenol for dog infant tylenol dosage
[url=http://tylenol.exegma.info/overdosing-on-tylenol--.html] overdosing on tylenol [/url][url=http://tylenol.exegma.info/tampering-tylenol---.html] tampering tylenol [/url][url=http://tylenol.exegma.info/motrin--.html] motrin [/url][url=http://tylenol.exegma.info/tylenol-pm.html] tylenol pm [/url]
February 16th, 2007 at 1:17 pm
hello, your site is lucky.
infant tylenol cold tylenol packaging case study cold flu tylenol
[url=http://tylenol.exegma.info/baby-tylenol.html] baby tylenol [/url][url=http://tylenol.exegma.info/generic-tylenol.html] generic tylenol [/url][url=http://tylenol.exegma.info/tylenol-pm-overdose.html] tylenol pm overdose [/url]
March 7th, 2007 at 1:38 pm
Hello, nice site look this:
lolicon lolikon 3d lolikon toons grand lolikon
[url=http://lolikon.lll1l.info/lolikon-anime--.html] lolikon anime [/url][url=http://lolikon.lll1l.info/lolikon-video---.html] lolikon video [/url][url=http://lolikon.lll1l.info/3d-lolikon-toons---.html] 3d lolikon toons [/url]
March 8th, 2007 at 1:37 am
Nice! We really amused by the website.
lolikon tgp 3d lolikon
[url=http://lolikon.lll1l.info/lolikon-picture.html] lolikon picture [/url][url=http://lolikon.lll1l.info/lolikon-hentai--.html] lolikon hentai [/url]
March 8th, 2007 at 1:56 am
hi
October 1st, 2007 at 8:26 pm
nice