Compare Numbers

Comparing two numbers is reasonably straightforward. However, be careful in one area; since DScript uses floating-point numbers in all mathematical operations, two numbers may display to be equal, but slight differences in trailing digits can cause the numbers to be different. For example, the result of the expressions ⅓ and 0.33333 are displayed in exactly the same way. However, the expression ⅓==0.33333 is false.

You can use the compare primitive to allow for rounding error when comparing numeric data. Compare lets you specify a tolerance value in addition to the two data items you are comparing.

See compare.

See Comparison Operators.