Index

Module 03 · FinanceThe Plumbing That Moves Money

Half a Point a Day, Gone - integer minor units, rounding and currency exponents

IEEE-754 Decoder
IEEE-754 Decoder · Open board

How a float is stored, and why 0.1 + 0.2 comes out as 0.30000000000000004. That board explains the machine. This lesson is what a ledger does about it: which number to store for money, and where rounding is allowed to happen.

Education, not financial advice.

Before you start. From A Book You Never Erase - the append-only ledger, reversals and derived balances: a ledger is entries you only add to, and every balance is the sum of its entries, so any error in a single entry is in the balance forever. From Numbers for Real (signed ints, overflow, floating point): a computer’s usual number with a decimal point, a float, stores most decimals only approximately, because 0.1 in binary repeats forever and has to be cut short. You do not need the bits; you need that one fact.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

Your program stores 0.1. What is actually in those 64 bits?

Type 0.1 in the box labelled A decimal number, click any exponent bit, and watch The exact value stored move.

Open Inside a float →

Review Finance →

Saved in this browser, and to your account when you sign in.