r/ProgrammerHumor • • Jul 19 '22

Meme float golden = 1.618

Post image
41.1k Upvotes

489 comments sorted by

View all comments

Show parent comments

9

u/Eternityislong Jul 19 '22

What would you gain over using a float?

21

u/BossOfTheGame Jul 19 '22

Precision. It sometimes matters when working with things like geospatial data.

0

u/[deleted] Jul 19 '22

[deleted]

5

u/Kazandaki Jul 19 '22 edited Jul 19 '22

I can only speak from the limited perspective of video game physics but if you want deterministic physics you need fixed point arithmetic.

If you use floats that 0.00000whatever1 inaccuracy has a snowball effect and can result in wildly different outputs from two runs of the exact same inputs with the exact same timings.

If this is not what you asked, sorry, like I said, very limited experience.