Java provides standard mathematical functions through the static methods of the java.lang.Math and java.lang.StrictMath (new in SDK 1.3) classes. These methods support absolute value calculation, trigonometry, exponentiation, min/max determination, rounding, random number generation, and other utilities. The java.lang.Math implementation won't necessarily produce identical results on different platforms. These differences are in the least-significant bits and are unimportant for most applications. However, SDK 1.3 added java.lang.StrictMath. This implementation does not perform as well as java.lang.Math, but its methods are guaranteed to produce platform-independent results. |