Java - Number

1 - About

Number, Numeric, Quantity in Java.

The abstract class Number is the superclass of platform classes representing numeric values that are convertible to the primitive types byte, double, float, int, long, and short.

3 - List

3.1 - Floating point

Number - Floating-point (system|notation) - (Float|Double) - Approximate numeric

The literal n.n is interpreted as a double.


double = 3.6

3.2 - Integer

3.3 - Fixed point

fixed point number (ie exact calculation) in java is implemented with the BigDecimal data type

  • Bigger than and bigger or equal

value.compareTo(BigDecimal.valueOf(10)) > 0
value.compareTo(BigDecimal.valueOf(10)) >= 0

  • Less Than and less than or equal

value.compareTo(BigDecimal.valueOf(10)) < 0
value.compareTo(BigDecimal.valueOf(10)) <= 0

4 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap