Floating Point Numbers - Computerphile
Computerphile2 HN recommenders · recommended in 2 months, 2015–2023
explainer · intro · evergreen · 2015–2023 on HN
Tom Scott explains for Computerphile how floating point numbers work, why moving the binary point is fast, and why it handles money badly.
Recommended as a simple, fun explanation of why floating point gives odd errors like 0.1 + 0.2.
Up next
6 mo on HNNet Neutrality: Last Week Tonight with John Oliver (HBO)
LastWeekTonight
7 HN recommender · 2014–2017
9 mo on HN"Turning the database inside out with Apache Samza" by Martin Kleppmann
Strange Loop Conference
9 HN recommender · 2015–2025
12 mo on HN8-bit computer update
Ben Eater
14 HN recommender · 2017–2023
11 mo on HNLight Years Ahead | The 1969 Apollo Guidance Computer
TNMoC
11 HN recommender · 2021–2026
11 mo on HN“Hello, world” from scratch on a 6502 — Part 1
Ben Eater
11 HN recommender · 2019–2026
10 mo on HNFinding the Missing Memristor - R. Stanley Williams
The Qualcomm Institute
12 HN recommender · 2010–2024
10 mo on HNThe Ultimate Game Boy Talk (33c3)
media.ccc.de
10 HN recommender · 2017–2026
11 mo on HNThe Thirty Million Line Problem
Molly Rocket
11 HN recommender · 2018–2024
9 mo on HNUSENIX ATC '21/OSDI '21 Joint Keynote Address-It's Time for Operating Systems to Rediscover Hardware
USENIX
12 HN recommender · 2021–2026
8 mo on HNJim Keller: Moore's Law, Microprocessors, and First Principles | Lex Fridman Podcast #70
Lex Fridman
8 HN recommender · 2020–2023
7 mo on HN34C3 - The Ultimate Apollo Guidance Computer Talk
media.ccc.de
9 HN recommender · 2018–2025
8 mo on HNJim Keller: Moore’s Law is Not Dead
UC Berkeley EECS
7 HN recommender · 2019–2025
3 comments from Hacker News
Short answer, no decimal in binary and math is hard. :) Here's a couple handy videos explaining it: ▶ this video link
Recommended: Floating Point Numbers - Computerphile ▶ this video Tom Scott's fun and simple take on Floating Points is a good video explaining why such weird errors happen
You should still not use MONEY in Postgres, even their own website says so [1]. I still wouldn't use floats/numerics/decimals to store currency either in any db generally, as said by others you're going to end up with inaccurate numbers [2]. Therefore using integers is in fact very good for this use-case, especially if you are in accounting or book-keeping! Source: I work for a Fintech company that processes millions of payments. [1] link [2] ▶ this video