Fotis wrote:
Hello Roberto
which are these solutions?
Well, the most used is to check if the difference from the two values is smaller than a very little number (tolerance).
Eg.
eps = 0.0001 ! <-- tolerance
IF x = 0 THEN GOSUB "errorcheck" ! <-- BAD CODING EXAMPLE
IF ABS(x) < eps THEN GOSUB "errorcheck" ! <-- GOOD CODING EXAMPLE
The first comparison (the "wanted" one!!) can result in an error message.
The second one checks if the value of the variable
x is "near enough" to zero (the "ABS" function ensures that the tolerance works for values above or below zero are).
_________________
--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________