stackyFACTS
Technology

Why 0.1 plus 0.2 isn't 0.3

HERE’S THE INTERESTING PART

Because computers are just giant calculators that occasionally forget how to do basic addition. If you add 0.1 and 0.2 in most programming languages, you get this monstrosity instead of 0.3, thanks to base-2 binary struggling to perfectly represent base-10 fractions.

Why 0.1 plus 0.2 isn't 0.3
STACKY / Technology
One discovery leads to another.

Keep exploring facts in this topic.

Technology →
STACKY FOR IPHONE

A bigger world.
One discovery
at a time.

Keep discovering with Stacky. Interesting facts in an app that is always within reach.

Download on the App Store
ONE MORE DISCOVERY?

Keep exploring

All in this topic →
Large floating point numbers lose single digit precision
Technology

Large floating point numbers lose single digit precision

As numbers get absurdly huge, computers just stop caring about the details. Floating point architecture prioritizes scale over exactness, meaning if a…

Discover more
Why virtual worlds fall apart at the edges
Technology

Why virtual worlds fall apart at the edges

If you travel far enough from the center of a virtual map, the mathematical grid inherently loses its precision. This causes character models to violently…

Discover more
Ada Lovelace, an English mathematician born in 1815, is widely recognized as the world's first computer programmer because she wrote an algorithm for Charles Babbage's…
Technology

Ada Lovelace, an English mathematician born in 1815, is widely recognized as the world's first computer programmer because she wrote an algorithm for Charles Babbage's…

Ada Lovelace, an English mathematician born in 1815, is widely recognized as the world's first computer programmer because she wrote an algorithm for Charles…

Discover more
Technology

A programming language built from Schwarzenegger quotes

Action heroes clearly make the best compilers. This fully functional programming language requires every single command to be a famous blockbuster one-liner,…

Discover more
A bad regular expression can freeze an entire app
Technology

A bad regular expression can freeze an entire app

Write one bad search pattern and watch your processor burst into flames. If a complex regular expression gets confused, it can enter a loop of guessing and…

Discover more
C's rand function is surprisingly predictable
Technology

C's rand function is surprisingly predictable

Nothing is truly random, especially not a lazy algorithm. The default 'rand()' function in C uses a very basic mathematical sequence that repeats itself so…

Discover more
StackyMore discoveries in the app
Download on the App Store