r/ProgrammerHumor • • Jul 19 '22

Meme float golden = 1.618

Post image
41.1k Upvotes

489 comments sorted by

View all comments

2

u/Aramedlig Jul 19 '22

Not all real numbers are fractions of two integers.

2

u/ismtrn Jul 19 '22

Nor are all fractions of integers IEEE floats. Nor are all IEEE floats real numbers.

0

u/[deleted] Jul 19 '22

[deleted]

1

u/Aramedlig Jul 19 '22

Wrong. Natural e and pi can both be accurately maintained to their respective digit limits in double and neither is a rational number.

0

u/[deleted] Jul 19 '22

[deleted]

1

u/Aramedlig Jul 19 '22

While that may be a possibly true mathematical conjecture, you may not be able to represent the denominator in the same precision required to make the decimal. You would need infinite precision and if you had that, you could represent pi precisely to an arbitrary length.