371
Floating-point Math Instructions
Section 5-24
Flags
ER:
Indirectly addressed EM/DM word is non-existent.
(Content of
*
EM/
*
DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
ON if the source data is not recognized as floating-point data.
EQ:
ON if both the exponent and mantissa of the result are 0.
OF:
ON if the absolute value of the result is too large to be expressed as a
32-bit floating-point value. (The result will be output as +
∞
.)
UF:
ON if the absolute value of the result is too small to be expressed as a
32-bit floating-point value. (The result will be output as 0.)
5-24-19 LOGARITHM: LOG(––)
Limitations
The source data in S+1 and S must be in IEEE754 floating-point data format.
DM 6143 to DM 6655 cannot be used for R.
Description
When the execution condition is OFF, LOG(––) is not executed. When the
execution condition is ON, LOG(––) calculates the natural (base e) logarithm
of the 32-bit floating-point number in S+1 and S and places the result in R+1
and R.
The source data must be positive; if it is negative, an error will occur and the
instruction won’t be executed.
If the absolute value of the result is greater than the maximum value that can
be expressed as floating-point data, the Overflow Flag (SR 25404) will turn
ON and the result will be output as
±∞
.
Note
The constant e is 2.718282.
S
: First source word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
R
:
First result word
IR, SR, AR, DM, EM, HR, LR
Ladder Symbols
Operand Data Areas
Third operand
:
Always 000
−−−
LOG(
−−
)
S
R
000
@LOG(
−−
)
S
R
000
R+1
R
S
Source (32-bit floating-point data)
S+1
Result (32-bit floating-point data)
log
e