dos_equal - dalefugier/DOSLib GitHub Wiki
Compares two numbers or two lists of numbers, approximately, by subtracting the two variables being compared and testing whether their difference is less than a value chosen at the limits of significance.
Syntax
(dos_equal number1 number2 [tolerance])
(dos_equal list1 list2 [tolerance])
Parameters
number1
The first number to compare.
number2
The second number to compare.
list1
The first numeric list to compare.
list2
The second numeric list to compare.
tolerance
The tolerance to compare against. Of omitted, the LUPREC system variable is used to calculate the tolerance (e.g. if LUPREC = 4, then tolerance = 0.0001).
Returns
T if the two numbers or lists are equal within tolerance, if successful.
nil of the two numbers or lists are not equal, or on error.
Example
Command: (dos_equal 3.14 3.14159)
nil
Command: (dos_equal 3.14 3.14159 0.01)
T
Command: (dos_equal '(1 3) '(1 3))
T