Why False | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Why False

Why 0.1+0.2==0.3 Output is false

16th Jun 2020, 2:45 PM
Mohammad
Mohammad - avatar
2 Respostas
+ 3
Because 0.1 +0.2 = 0.300000004 != 0.3
16th Jun 2020, 2:58 PM
Abhay
Abhay - avatar
0
Try this for comparision upto 2 decimal places, print(round(0.1+0.2,2)==0.3)
16th Jun 2020, 3:03 PM
$Ā¢šŽā‚¹š”­!šØš“
$Ā¢šŽā‚¹š”­!šØš“ - avatar