© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
J. FriesenLearn Java Fundamentalshttps://doi.org/10.1007/979-8-8688-0351-2_12

12. Math, BigDecimal, and BigInteger

Jeff Friesen1  
(1)
Dauphin, MB, Canada
 

Mathematics operations are an important part of computing. You learned about basic math operators (such as addition and multiplication) in Chapter 3. Java also provides a Math class in the java.lang package, along with BigDecimal and BigInteger classes in the java.math package. This chapter introduces you to these classes.

Math

The Math class augments the basic math operators with useful static constants and methods. This section presents these constants and explores a few of these methods.

Note

You might be ...

Get Learn Java Fundamentals: A Primer for Java Development and Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.