stosb

wearer of programming socks

  • she/her

mid 20s | bisexual | programmer | european


profile pic: a picrew by Shirazu Yomi
picrew.me/en/image_maker/207297
i use arch btw
xenia the linux fox -> πŸ¦ŠπŸ³οΈβ€βš§οΈ
the moon
πŸŒ™

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