整数和浮点数(Integers and floating point numbers)

整数有多个进制

  二进制0b开头

  八进制0开头

  十六进制0x开头  0-9 A-F

浮点数

  位数有限  有限位数的数

  离散

  舍入误差  有四舍五入

  大约  接近但不等于

  尽量避免使用浮点数进行比较

金额用BigDecimal

————————

Integer has more than one base

Starting with binary 0b

Octal 0

Hex 0x start 0-9 A-F

Floating point number

Number of finite digits

Discrete

The rounding error is rounded

Approximately close to but not equal to

Try to avoid using floating-point numbers for comparison

金额用BigDecimal