Skip to content

Instantly share code, notes, and snippets.

@kkeeth
Last active May 25, 2016 03:11
Show Gist options
  • Save kkeeth/9520629 to your computer and use it in GitHub Desktop.
Save kkeeth/9520629 to your computer and use it in GitHub Desktop.
JavaScriptの丸め誤差の確認
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