Computes (ST(1) * log_2 (ST(0))), stores the result in resister ST(1), and pops the FPU register stack. The source operand in ST(0) must be a non-zero positive number.
The following table shows the results obtained when taking the log of various classes of numbers, assuming that neither overflow nor underflow occurs.
FYL2X Results
- | ST(0): -inf | ST(0): -F | ST(0): +-0 | ST(0): +0 < | +F < +1 | +1 | ST(0): +F > +1 | +inf | NaN |
ST(1): -inf | * | * | +inf | +inf | * | -inf | -inf | NaN |
ST(1): -F | * | * | ** | +F | -0 | -F | -inf | NaN |
ST(1): -0 | * | * | * | +0 | -0 | -0 | * | NaN |
ST(1): +0 | * | * | * | -0 | +0 | +0 | * | NaN |
ST(1): +F | * | * | ** | -F | +0 | +F | +inf | NaN |
ST(1): +inf | * | * | -inf | -inf | * | +inf | +inf | NaN |
ST(1): NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
F Means finite floating-point value. |
* Indicates floating-point invalid-operation (#IA) exception. |
** Indicates floating-point zero-divide (#Z) exception. |
If the divide-by-zero exception is masked and register ST(0) contains +-0, the instruction returns infinite with a sign that is the opposite of the sign of the source operand in register ST(1). |
The FYL2X instruction is designed with a built-in multiplication to optimize the calculation of logarithms with an arbitrary positive base (b): |
[code] |
log_b(x) = log_2(x) / log_2(b) |
[/code] |
|