 | Cx51 User's Guide |  |
|
|
| log10517| Summary |
#include <80c517.h>
float log10517 (
float val); /* value to take common logarithm of */
| | Description | The log10517 function calculates the common logarithm for the floating-point number val. The logarithm is the exponent to which the base (10 in the case of common logs) must be raised to equal val. Or, log10 10x = val For example, log10517(120) = log10517(102 × 1.2) = 2 + log10517(1.2) ≈ 2 + 0.079181 or 2.079181
Note - This routine uses the arithmetic unit of the Infineon C517x/C509 to provide accelerated execution speed. Do not use this routine with a CPU that does not support this feature.
| | Return Value | The log10517 function returns the floating-point common logarithm of val. - If x < 0, log10517 returns NaN.
- If x = 0, log10517 returns -INF.
| | See Also | exp, exp517, log, log10, log517, pow | | Example |
#include <80c517.h>
#include <stdio.h> /* for printf */
void tst_log10517 (void) {
float x;
float y;
x = 2.718282;
x *= x;
y = log10517 (x); /* y = 2 */
printf ("LOG10517(%f) = %f\n", x, y);
}
|
|
|