• 11 Posts
  • 76 Comments
Joined 4 months ago
cake
Cake day: September 13th, 2024

help-circle















  • HiddenLayer555@lemmy.mltoProgrammer Humor@lemmy.mlIEEE 754
    link
    fedilink
    English
    arrow-up
    5
    ·
    12 days ago

    There’s really not a lot of situations where exact fractions work, but purely symbolic logic wouldn’t. Maybe none, IDK.

    Simulations maybe? Like the ones for chaotic systems where even the slightest inaccuracy massively throws the result off, where the tiny difference between an exact fraction and a float can seriously impact the accuracy as small errors build up over time.


  • HiddenLayer555@lemmy.mltoProgrammer Humor@lemmy.mlIEEE 754
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    12 days ago

    Performance penalty I would imagine. You would have to do many more steps at the processor level to calculate fractions than floats. The languages more suited toward math do have them as someone else mentioned, but the others probably can’t justify the extra computational expense for the little benefit it would have, also I’d bet there are already open source libraries for all the popular languages of you really need a fraction.








  • To be fair, let’s not pretend we haven’t all written JS to resize shit in desperation when the CSS doesn’t work. Though the better way to do this would probably be to listen for the window size change to fire your style changing functions. That makes it behave more like responsive CSS that changes automatically when you resize the window (though with a slight lag sometimes because it’s a lot more computationally expensive). Though it could also be due to the browser putting unused tabs to sleep and stopping JS execution which would be outside the website’s control.