Skip to content

Data Representation and Numerics — Junior

Fixed-width integers have ranges; signed integers commonly use two’s complement. IEEE 754 floating point approximates most decimal fractions. Unicode code points become bytes through encodings such as UTF-8.

Use decimal/fixed-point rules for money, explicit encodings at I/O boundaries, and test minimum, maximum, zero, NaN, infinity, and non-ASCII text.

Test yourself

  1. Why can integer overflow wrap or trap?
  2. Why is 0.1 approximate?
  3. Are code points the same as user-visible characters?

Continue to middle.md.