posted 9 months ago

- 1

Have you found out that Java® supports three kinds of built‑in arithmetic?1: Integer arithmetic, e.g. with 2: Floating point binary arithmetic, i.e. 3: Fixed point decimal arithmetic with BigDecimal. Integer arithmetic only suffers one potential error, though it has all sorts of peculiar rules, e.g. about division and about mixing different types. Integer arithmetic and decimal arithmetic are absolutely accurate unless that one potential error occurs. Decimal arithmetic also has some peculiar rules about division. Floating point arithmetic is almost always imprecise, and it has other peculiar rules, including rules about division by 0. It follows IEEE754. NaN is probably the strangest part of IEEE754.

You can find more details in the Java® Language Specification (beware: some bits will be difficult to read), starting with this section. Keep reading until you reach the bitwise OR operator, and see whether you are still awake.

`int`s or BigInteger.

`double`s and

`float`s.

You can find more details in the Java® Language Specification (beware: some bits will be difficult to read), starting with this section. Keep reading until you reach the bitwise OR operator, and see whether you are still awake.