O'Reilly logo

Technical Java™: Developing Scientific and Engineering Applications by Grant Palmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. Built-in Math Functions

Despite some ill-informed opinions to the contrary, Java is a programming language that is well suited to perform mathematical computations. The Math and StrictMath classes from the java.lang package offer a wide variety of built-in math methods. The capability includes methods to perform absolute value, power, square root, exponential, logarithmic, trigonometric, minimum, maximum, and rounding operations. The Java math methods are based on Institute of Electrical and Electronics Engineers (IEEE) mathematical algorithms.

The java.math package contains two classes that encapsulate variable precision integer and decimal values. These classes allow you to specify how numbers are rounded. The BigDecimal and BigInteger ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required