liveBook · Manning

Precision

As explained in Deep Learning with R, Third Edition

Floating-point precision is the degree of numerical detail representable by a floating-point data format.

Floating-point precision measures how finely a computer can represent numerical values. Unlike the continuous real-number line, a floating-point format provides only finitely many representable points between values. section 18.3.1

Common floating-point formats trade numerical detail, storage, and computation:

  • float16, or half precision, stores numbers in 16 bits. section 18.3.1
  • float32, or single precision, stores numbers in 32 bits and can represent very small values useful for stable training gradients. section 18.3.1 section 16.4.1
  • float64, or double precision, stores numbers in 64 bits; float8 provides an even lower-precision option. section 18.3.1

Floating-point values are encoded using a sign, a significant value called the mantissa, and an exponent. Representable values are not evenly spaced: larger numbers generally have lower precision, so conversion error depends strongly on the value’s magnitude. section 18.3.1

Encoding π in float32

A float32 representation approximates π using a sign bit, an integer exponent, and an integer mantissa. The result is close to π rather than exactly equal to it because only a finite set of values is representable. section 18.3.1

The number pi encoded in single precision via a sign bit, an integer exponent, and an integer mantissa
sidebar figure

Inspect the figure to see how π is encoded through its sign bit, exponent, and mantissa. section 18.3.1

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains finite numerical resolution, precision levels, floating-point encoding, uneven spacing, and value-dependent representation error.
Examples
Uses uint8 ranges, the real-number line, and float32 encoding of π to make finite numerical resolution concrete.
What you can do after
Apply float16 or bfloat16 for memory-efficient inference, while recognizing why float32 can support stable training gradients.
How it connects
Connects precision to floating-point encoding, mantissa, exponent, numerical error, training gradients, and precision-recall metrics.

Also explained in

Compare how 9 books explain precision →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.