+ 1
Comparison operator
Hey, could anyone help me and describe why is the code result false? Thank you. https://code.sololearn.com/cI3mPhE56HAd/?ref=app
1 Respuesta
+ 8
You are comparing a float type variable <f> with a double type literal (0.1), try `if(f == 0.1f)` this will compare <f> with a float type literal, and outputs "true".