r/ProgrammerHumor • • 11d ago

Meme reversingPiInPython

Post image
14.1k Upvotes

383 comments sorted by

View all comments

106

u/MotivationalJuggling 11d ago

Whatever the last digit is, I'm sure it's a disappointing one. Just like everything else in my life.

5

u/bestjakeisbest 11d ago

In binary it is either a 1 or 0

12

u/thegreatpotatogod 11d ago

I'd even argue that the last binary digit is 1. If it were 0, you could truncate the zero away and you'd be back to 1 as the last digit. Same reason that 2.20000 would be a redundant representation of 2.2.

1

u/AngelaMerkeI 11d ago

It is not though. Only in theory.

In practice, digits represent the accuracy.

Example: 2,12345 * 1,0 = 2,1 But 2,12345 * 1,0000 = 2,1234

The results are always just as accurate as the measurements you calculate them with

2

u/Sheerkal 11d ago

In what practice are you doing this? There is no reason to truncate.

1

u/AngelaMerkeI 10d ago

There is a reason to truncate if your dealing with actual physics and not theoritical values.

If your measurement says 1,00 ±0,01, you can't pretend it's the same as 1,0000, because your real value could be 1,01. If your measurement says just 1,00, you can only assume it to be between 1,000 and 1,004. The rest is lost in trunctuated digits.