I was writing a UI for a tool and when the user put in some value to the text box, it would set that value to the actual thing (game object) and then “refresh” the UI from the object’s values. Things like 30.5 became 30.499999. Drove the artists crazy.https://twitter.com/rygorous/status/1199907546988892160 …
I’m curious whether you referenced something or just knew off the top of your head. As I was composing the tweet, I was trying to think of a number that reasonably illustrated the idea and checking if it was representable or not crossed my mind.
-
-
Knew off the top of my head. Anything that is "small integer * power of 2 with reasonable exponent" (negative or positive powers) is a machine number. This one is 61/2 so it's definitely easy. When either numerators or denominators get large you need to get careful. :)
Kiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.