Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Delphi-News aus aller Welt (https://www.delphipraxis.net/58-delphi-news-aus-aller-welt/)
-   -   Traps and explanations when comparing non-integer types (floating-point, fixed-point) (https://www.delphipraxis.net/216345-traps-explanations-when-comparing-non-integer-types-floating-point-fixed-point.html)

DP News-Robot 14. Dez 2024 11:10

Traps and explanations when comparing non-integer types (floating-point, fixed-point)
 
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'); …


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:07 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz