All numbers are 64-bit floats (IEEE 754). bigint for huge integers.
- no separate int type —
1and1.0are the same NaN= Not a Number;NaN !== NaNInfinityand-Infinityexist- floating point is imprecise:
0.1 + 0.2 !== 0.3 - parse with
Number(),parseInt(),parseFloat()
See examples/.
Write round2(n) returning a number rounded to 2 decimals.