I would like the ability to unite decimal and integers both referenced
a numeric type. For example a multiply of a decimal and integer would
result in a decimal result. However if both inputs are integers the
number type would hold an integer internally. I guess i want something
like hold numbers are handled in ruby/jruby but without the ruby
overhead.

In the end im looking for a variant that holds integers, decimals with
lots of functions. BigDecimal unfortunately comes with only basic
functionality and is missing many of the functiosn on Math. Yes i know
BigDecimal technically not a floating point number w/ MathContext
precision etc can be controlled with much more precision and accuracy.

Googling unfortunately produced very little in terms of a solution to
this problem.


jruby.
-------
- no support for passing a math context like BigDecimal. This is a
really cool feature imho that seems lacking in other java math
libraries (apache commons math and dfp from sourceforge).
- unfortunately the number types are very much aware of the jruby
runtime and all the magic that happens to make ruby work. It would
have been nice if the value holders were not aware of the runtime but
they did their magic like never overflowing and so on.
- I would like to use these number types in GWT and on quick
examination there area lot of Ruby types to fake out for GWT client
side.

apache commons math
---------------------------------
- very poor integration between BigDecimal and DFP - the main apache
commons math "decimal" class.
- the only ctors available are for the primitive types and String.
- i guess String should suffice but it seems like a poor choice if one
wants a performant system. This might be nonsense as these classes
might not hog to much cpu in the end.

http://dfp.sourceforge.net/
-----------------------------------
- has a lot of the similar short comings that i mention above in
acmath. Look around the api and code i cant but help wonder about
cross polination between acm and dfp.
- precision is a property of each number. This feature really sucks, i
wont elaborate on how less flexible this is compared to the BigDecimal
MathContext solution

Jython
---------
I havent inspected its number types but i suspect its going to be a
bit of a mess like JRuby.

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to