liveBook · Manning

Exponent

As explained in 100 Go Mistakes and How to Avoid Them

An exponent is the multiplier component that determines the power applied to a floating-point mantissa.

In floating-point representation, an exponent determines the power applied to the mantissa. A value is calculated as sign × 2^exponent × mantissa. The exponent and mantissa occupy separate bits, while another bit stores the sign. section 3.3

Float32 representation of 1.0001

For float32, the exponent uses 8 bits. The bit pattern 01111111 represents 2^0, while the mantissa is approximately 1.000100016593933. Therefore, the stored value is 1 × 2^0 × 1.000100016593933—not exactly 1.0001. section 3.3

How 100 Go Mistakes and How to Avoid Them covers it

How deep it goes
Defines exponent bits and their role in the representation, but stops short of explaining conversion mechanics.
Examples
Uses the float32 encoding of 1.0001 and the formula sign × 2^exponent × mantissa.
What you can do after
Evaluate/understand why a floating-point value can differ from its written decimal form.
How it connects
Links exponent with mantissa, sign, IEEE-754, float32, float64, and floating-point precision.

Also explained in

Compare how 2 books explain exponent →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 Go Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.