3
ram-mar
6y

Javascript never ceases to amaze me.

0.3 - 0.1 = 0.199999999999998

😁😁😁

Comments
  • 10
    That's not really a js issue though.
  • 6
    YOU LOOK STOOPID NOW.
  • 7
    Try is JS. Get a wrong result

    Try in python. Get the same result

    Try in another * language. Still get the same result.

    .

    .

    .

    Let's blame decimal floating problems to JS. YaY!
  • 3
    Rinse and repeat 1000x. Congrats, you now have half of Devrant posts.
  • 1
    @korengali Well, atleast I learned something
  • 0
    There is this famous list of things that seems a bit wonky in JS, though when you actually look at it most of it makes good sense
  • 0
    One thing is there is no standard way to deal with this in js where other lang like c# for example has the Decimal type
  • 1
    Many people seem to think that Js is a simple language with lots of little errors, when actually it's a really complex language under the hood
  • 1
    (0.3*10 - 0.1*10)/10 = 0.2
  • 0
    I don't understand why this is an issue but that's me

    Edit... I understand why it's an issue, I don't understand why it happens is what I meant
  • 0
    @kenogo ahh so without defining a floor there's no way the system can't do it without rounding
  • 1
    It is a cs problem you dummy dumb
Add Comment