MathFP
Because CLDC doesn't provide the primitive Java types float and double or the corresponding classes Float and Double, it seems that you cannot write a J2ME CLDC application that performs mathematical calculations beyond integer calculations. As a substitute for the missing floating-point arithmetic, Onno Hommes created a library called MathFP providing 32-bit fixed-point integer math functions. The MathFP library and the corresponding documentation can be downloaded at http://www.jscience.net.
To perform calculations in the MathFP format, you need to convert an integer or a string representing a floating-point value to the MathFP format. Those conversions are performed using the static methods of the class MathFP given in Table 10.4.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access