Board index » delphi » comparing real data type
Terry
Delphi Developer |
Terry
Delphi Developer |
comparing real data type2003-11-20 05:29:30 AM delphi68 I have two variable of type real. when I display their values using the de{*word*81}, both display a value of 1. but the following if statement fails. if real1 = real2 then do something; how can I do this? |
Doug Horton
Delphi Developer |
2003-11-20 12:35:11 PM
Re:comparing real data type
www.healthytree.net/WebOffice/Banners/email
"Terry" <XXXX@XXXXX.COM>writes QuoteI have two variable of type real. when I display their values using the --Doug |
Clay Shannon
Delphi Developer |
2003-11-20 10:48:30 PM
Re:comparing real data type
"Terry" <XXXX@XXXXX.COM>writes
QuoteI have two variable of type real. when I display their values using the ACCEPTABLE_DELTA = 0.0001 var dDiff: Double; begin dDiff := Abs(Float1-Float2); if dDiff>ACCEPTABLE_DELTA then {there's trouble in River City} else {everything is beautiful/don't worry, be happy} |