ysaie

31 / ⚧ / code, music, art, games

──────────────────────────────
🌸 many-shaped creature
✨ too many projects
🚀 cannot be stopped
🌙 stayed up too late
:eggbug: eggbug enjoyer
──────────────────────────────
header image: chapter 8 complete from celeste
avatar: made using this character builder


📩 email
contact@echowritescode.dev

kodicraft
@kodicraft

this might be a hot take and i quite frankly havent thought about this too much but floating point values being the "default" way to handle any sort of fractional component even in tools designed to be accessible to non-insane people is a terrible idea, floating point values are good because they're a single format for a huge range but if you know the order of magnitude that your use case will need or even can vaguely approximate it you will almost always get more reliable behavior with fixed-point values. if i primarily expect fractional values between 0 and 100 why would I waste so many of my precious bits to poorly approximate 40 billion



You must log in to comment.

in reply to @kodicraft's post:

rational numbers can cause problems for normal people but yeah I wish more programming languages just had built-in support for rational numbers and presented that as a preferred way to represent precise fractional values

real answer probably because it's not that many bits wasted due to the log-log size of the exponent, and because having generalized hardware to handle this numeric format reliably and consistently is a huge boon in general