Registriert seit: 4. Jun 2010
15.785 Beiträge
|
Traps and explanations when comparing non-integer types (floating-point, fixed-point)
14. Dez 2024, 11:10
Recently I got a very nice question about comparing non-integer values in Pascal (thank you to Jacek Mulawka!). The core of the question was: Does the condition below (if) evaluate to true or false, and why? MyVar := 0.1; if MyVar = 0.1 then Writeln('Yes, MyVar equals 0.1') else Writeln('No, MyVar does not equal 0.1'); …
|