leary (javascript and etc) created by rao (artist)
Viewing sample resized to 66% of original (view original) Loading...
Description

まるめごさ
rounding errors

Blacklisted

    var a = 0.3 - 0.2; var b = 0.2 - 0.1; var c = a == b; console.log("a:"+a); console.log("b:"+b); console.log(c);

    Try it at home!

  • Reply
  • |
  • 6
  • N

    lafcadio said:
    var a = 0.3 - 0.2; var b = 0.2 - 0.1; var c = a == b; console.log("a:"+a); console.log("b:"+b); console.log(c);

    Try it at home!

    No thank you, I've had enough with programming

  • Reply
  • |
  • 1
  • funny_man7282 said:
    blame the u, not the js

    Well... you should kinda just blame math for this one, or, at least, the fact that Javascript isn't designed to work with decimal fractions by default. IEEE FP is only really used because it's easier for most tasks like this.

  • Reply
  • |
  • 1