all 6 comments

sorted by: hot top controversial new old
[–] 8 points 3 months ago* (3 children)

Just store the fraction as a varchar like “11/17”, duh

  • source
  • hideshow 3 child comments
  • [–] 3 points 3 months ago (2 children)

    Is that done in some environments? I think Maxima gives answers as fractions by default, but didn't know how that worked. And my Casio calculator can stick to fractions and surds up to a point, but I think it's just using float under the surface and converting back ok until too much rounding error creeps in...

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 3 months ago (1 child)

    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)

  • source
  • hideshow 1 child comment
  • 4 comments in c/memes@lemmy.ml view that post
    [–] 11 points 3 months ago

    Son of a bitch. Actual fifteen seconds of real laughter. Maybe even twenty.

  • source
  • [–] 1 point 3 months ago (2 children)

    Funny meme, never got why they used a bias instead of two's complement for the exponent though

  • source
  • hideshow 2 child comments
  • [–] 5 points 3 months ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment