Just store the fraction as a varchar like “11/17”, duh
post
replies:
The coolest part is you can do log math since you have the mantissa and exponent already for extremely fast multiplication and division (+ or - log values)
4 comments in c/memes@lemmy.ml view that post
Son of a bitch. Actual fifteen seconds of real laughter. Maybe even twenty.
Funny meme, never got why they used a bias instead of two's complement for the exponent though
replies:
permalink
fedilink
source
parent
hideshow 1 child comment
they could have used two’s complement for the exponent, but the biased exponent is objectively a better encoding for what floating point hardware needs to do.
This is paraphrased like mad, but basically that means hardware can compare exponent fields as plain unsigned integers. With twos complement, unsigned comparison says 255 > 1, even though -1 < 1. So every comparison would need special signed comparison logic.
all 6 comments