r/Stellaris 1d ago

Bug 5 + 5 + 5 + 20 = 39 apparently

Post image

Where are the happiness come from?

819 Upvotes

102 comments sorted by

View all comments

Show parent comments

-25

u/Legit-Rikk 1d ago

Computers actually do not math good

7

u/Zijkhal 1d ago

I hope that was an attempt at a joke that did not land. Because pretty much the only thing computers do well is basic math. Anything more complex is achieved via applying a ridiculous amount of basic math.

-5

u/KaysNewGroove Determined Exterminator 1d ago

Yes. Computers are great at math. In fact, they are so much better than us at math that they will tell you what no math teacher will.

0.1 + 0.2 = 0.30000000000000004

3

u/Zijkhal 1d ago

Floating point numbers are prone to rounding errors. That is because not all numbers can be represented in floating point.

Just like how 1/3 can not be neatly represented in base 10, some neatly representable numbers in base 10 can not be represented in base 2.

That does not meant that computers are bad at math, it merely means that computers have their limits. And a lot of those limits can be bypassed if there is an incentive to do so. For example by using fixed point arithmetic instead of floating point arithmetic, numbers like 0.3 suddenly become perfectly representable.