TIL Mastodon uses IEEE754 or something when counting poll results
=> More informations about this toot | More toots from jpm@aus.social
Hey @shlee do the Aus.social servers have that Pentium division bug?
=> More informations about this toot | More toots from jpm@aus.social
@jpm
User: numbers don’t sum to 100%
Dev: it’s correct rounding (close)
User: but they need to sum to 100%
Dev: working to spec (close)
User: just tweak a number to make it 100%
Dev: but that’s just as wrong, in a different way (close)
User: but it needs to sum to 100%
Senior: oh dear god is this still open? Just make the last one 100-sum. It’s dumb but all options are bad here.
=> More informations about this toot | More toots from drew@eigenmagic.net
@jpm @shlee cool that whatever math library it uses has rounded 12.5 up to 13 but (presumably) 49.999 down to 49.
Is there an IEEE floating point "round to odd integer" mode?
(Also, I wonder what calculation was going on such that 4 out of 8 was not represented as exactly 0.5, which can be exactly represented by a binary floating point number, unlike 0.1)
=> More informations about this toot | More toots from markjustmark@aus.social
@jpm I think that’s the client… but maybe 😅
=> More informations about this toot | More toots from shlee@aus.social
@shlee can you comment @ivory ? Every possible way to add up these poll numbers is wrong…
=> More informations about this toot | More toots from jpm@aus.social
@jpm There will always potentially be slight rounding errors depending on certain scenarios because we want to keep the UI simple with whole numbers.
=> More informations about this toot | More toots from ivory@tapbots.social
@jpm @shlee I'm sure there's a library you can import to add it if it doesn't.
=> More informations about this toot | More toots from abstractcode@eigenmagic.net
@jpm I'm curious what the percentages would be if there were equal votes for three options.
=> More informations about this toot | More toots from gptreb@aus.social
@jpm 99%
=> More informations about this toot | More toots from shlee@aus.social
@shlee @jpm I'm seeing similar on a different server.
Not sure how it's represented in the Mastodon server itself (which is Ruby), but maybe it's front-end JavaScript?
JavaScript has no Integer data type, only Number (which is 64-bit IEEE-754) and BigInt (a uin64_t basically).
=> More informations about this toot | More toots from stuartl@longlandclan.id.au
@shlee hahahahahahaha even better!
=> More informations about this toot | More toots from jpm@aus.social This content has been proxied by September (3851b).Proxy Information
text/gemini