Skip to content

Instantly share code, notes, and snippets.

@mattocchi
Created August 21, 2018 10:04
Show Gist options
  • Save mattocchi/f0e54cbafbbd76df595947e9db21885e to your computer and use it in GitHub Desktop.
Save mattocchi/f0e54cbafbbd76df595947e9db21885e to your computer and use it in GitHub Desktop.
Errori Arrotondamento Float
var x = .3 - .2; // trenta centesimi meno venti centesimi
var y = .2 - .1; // venti centesimi meno dieci centesimi
x == y; // => false
x == .1; // => false: .3-.2 non è uguale a .1
y == .1 // => true: .2-.1 è uguale a .1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment