==R

Top  Previous  Next

 

Accu 1 and accu 2 are compared and the RLO will be set to 1 if they are the same, otherwise to 0. It is important that both operands are already in the REAL-format. If one of the operands is loaded as Int or DInt it will have to be changed into a REAL-number with DTR before comparing. If an operand that is loaded as Int can be negative it will also have to be extended to the Dword-format with ITD before.

 

The comparison of REAL-numbers to ‘equal’ leads quite often to maloperations of the program because of rounding errors. Instead of ‘==R’ you should better substract the numbers that are to be compared and compare the absolute value of this with ‘<R’ to an upper limit.

 

 L        MD 40

 L        2.0                // The point is important!

 ==R

 Q        Q 22.4                // If MD40 equals 2.0 Q22.4 will be set to 1,

                             otherwise to 0

 

.

 

See also:

-R

ABS

<=R

>=R

 

List of operations