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.
Articles Related
List
Floating point
Number - Floating-point (system|notation) - (Float|Double) - Approximate numeric
The literal n.n is interpreted as a double.
double = 3.6
- double is a double precision floating point number (ie 64-bit precision IEEE 754 floating point)
- float is a single precision floating point number (ie 32-bit precision IEEE 754 floating point)
Integer
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