leary (mythology) created by rao (artist)
Viewing sample resized to 88% of original (view original) Loading...
Description

まるめごさ
rounding errors

  • Comments
  • 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
  • |
  • 5
  • 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
  • |
  • 0
  • funny_man7282 said:
    blame the cpu, 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
  • |
  • 0