Skip to content
Numbers & Money
-
Numbers & Money
Rounding Modes: Banker's Rounding, 1.005 and Sales Tax
Numbers lecture 3: round(2.5) in 9 tools gave 2 or 3, -2.5 split three ways, 1.005 became 1.00 or 1.01, and per-line sales tax differed from per-order. All run.
-
Numbers & Money
Number Formatting and Parsing Across Locales
Numbers lecture 5: "1,5" became 15 in .NET, Java and PHP intl, es-ES atof read 1.5 as 15, PHP cast 123 to 0, and tools disagreed on 1234 vs 1.234. Real runs.
-
Numbers & Money
Integer Overflow, BigInt and Safe Limits by Language
Numbers lecture 2: INT_MAX + 1 in C, Java, C#, Swift, Dart, PHP and Python, why JSON.parse changes 19-digit IDs, strings vs BigInt, and SQLite limits.
-
Numbers & Money
Float Summation Error, NaN and -0.0, Measured
Numbers lecture 6: summing 10^7 doubles drifted 396 ulps, Python 3.12 sum() was exact, -ffast-math deleted Kahan and turned 0/0 into 1, and NaN broke sorting.
-
Numbers & Money
Why 0.1 + 0.2 Isn't 0.3: Floating Point Basics
Numbers lecture 1: 0.1 + 0.2 run in nine languages, the exact value a double stores, why print hides the error, and how to compare floats with a tolerance.
-
Numbers & Money
Money in Code: Integer Cents vs Decimal Types
Numbers lecture 4: int(19.99*100) gave 1998, BigDecimal 2.0 != 2.00, bcmul dropped cents, naive splits failed 32% of the time, and decimals cost 2.7x to 21x.
↑