I'm trying to write a simulator for a hardware device with fairly low numerical accuracy (preferably in Java), and I'm looking for a library that implements elementary math operations.
In particular, I need a class that implements binary floating-point arithmetic and allows the user to specify the accuracy of both the mantissa and the exponent. (Probably 8 or 10 bits for the mantissa and 6 or 8 bits for the exponent.)
I looked at many packages designed for high precision arithmetic (Apfloat, jScience, the Dfp class in the Apache Commons package), but they all either have a radix 10 support problem only or they do not allow the user to control the accuracy of the exponent.
Do you have suggestions for Java packages that are better suited for my purpose or tips on how to modify an existing library to do what I want?
source share