this post was submitted on 08 Sep 2023
224 points (94.8% liked)

196

16859 readers
2661 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 28 points 1 year ago (1 children)

Programmer: 2 + 2 is 3.99999999999999999

[โ€“] [email protected] 25 points 1 year ago

2 + 2 == 4 with any reasonable fixed and floating point format. In ieee 754 floats powers of 2 have a fraction of exactly 1.0 and differing exponents.