News for hackers. Stuff that matters.
Re:Pretty.c by jdthedisciple on Thursday October 24, 2024 @04:19PM (#41939314)
Oh you're right, thanks for the explanation!

Gotta research now where the 0.00000011920929 number comes from...

Re:Pretty.c by masklinn on Thursday October 24, 2024 @04:27PM (#41939403)
It's the distance between 1.0 and the next representable float.
Re:Pretty.c by jdthedisciple on Thursday October 24, 2024 @04:47PM (#41939585)
I got that but I am curious how to derive that number.

Is it representable as a non-trivial ratio of integers?

Re:Pretty.c by hmry on Thursday October 24, 2024 @05:25PM (#41939960)
Good question! It's 1/(2**23), because 32 bit floats have 23 bits after the decimal point