APDR

Floating-Point Numbers Lab

Algorithms, Programming, and Data Representation · Module 92313 · Chapter 4

Predict first, then reveal. Watch how binary places, exponent zones, rounding, and IEEE fields determine a floating-point value.

How the lab works

  1. Predict. Commit to an answer before the stage moves.
  2. Rate your confidence. Sure but wrong answers appear under Your results.
  3. Watch the reveal. Follow the place values, exponent alignment, or stored fields.
  4. Explore. Finish an experiment to open its controls and tick its lab skill.

4.1 Range and precision: map one exponent zone

The exponent selects a magnitude zone.

The significand precision sets the number of representable steps inside it.

Each tick is one representable value.

Inspect the spacing

Adjacent gap: —

4.2 Binary fractions: add the place values

Each bit after the point has half the weight of the previous bit.

Only positions containing 1 contribute to the decimal value.

Place values after the binary point are 2⁻¹, 2⁻², and so on.

Convert a binary fraction

Decimal value: —

4.3 Arithmetic: align, operate, and round

Multiplication combines significands and adds exponents.

Addition first shifts the smaller significand to a shared exponent.

IEEE addition also restores the hidden bit before aligning binary significands.

Try floating-point arithmetic

IEEE mode always adds two single-precision values. Decimal exponents, operation, and digit precision apply only in decimal mode.

Result: —

4.4 IEEE 754: read the single-precision fields

Single precision stores a sign bit, a biased exponent, and a fraction.

For normalised values, the leading 1 is implicit.

Read each stored field separately.

Encode or decode one float

Value and fields: —

4.5 Special values: classify the reserved patterns

All-zero and all-one exponent fields have special meanings.

Check the fraction field too, because it distinguishes infinity from NaN and zero from a denormalised number.

Zero and all-one exponent fields reserve patterns for special values.

Classify single-precision fields

Classification: —

Your results

Personal study lab based on the Chapter 4 guide and the supplied “04_floating_point_numbers.pdf”. The arithmetic sandbox uses finite decimal precision for its scientific-notation mode; its IEEE mode uses browser single-precision values. Not an official FAU publication; check course details against the current notes. Made by Thanate Amornjiraporn (Focus).