Last active
May 25, 2016 03:11
-
-
Save kkeeth/9520629 to your computer and use it in GitHub Desktop.
JavaScriptの丸め誤差の確認
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sum=0, num=0; | |
for(i=0; i<100; i++) { | |
sum += 0.1; | |
console.log('sum = ' + sum); | |
} | |
num = 0.1 * 100; | |
console.log('num = ' + num); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment