Why (0.0015 * 3) == 0.0045 does not return true? [duplicate]

1

Hello,

Why does (0.0015 * 3) == 0.0045 in javascript compare not true?

Ex:

var valor1 = 0.0015 * 3;
var valor2 = 0.0045;

if(valor1 == valor2) {
    console.log('Igual');
} else {
    console.log('Diferente');
}
    
asked by anonymous 17.08.2017 / 21:11

0 answers