 | Cx51 User's Guide |  |
|
|
| log517| Summary |
#include <80c517.h>
float log517 (
float val); /* value to take natural logarithm of */
| | Description | The log517 function calculates the natural logarithm for the floating-point number val. The logarithm is the exponent to which the base (e or 2.718282... in the case of natural logs) must be raised to equal val. Or, loge ex = val 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 log517 function returns the floating-point natural logarithm of val. - If x < 0, log517 returns NaN.
- If x = 0, log517 returns -INF.
| | See Also | exp, exp517, log, log10, log10517 | | Example |
#include <80c517.h>
#include <stdio.h> /* for printf */
void tst_log517 (void) {
float x;
float y;
x = 2.718282;
x *= x;
y = log517 (x); /* y = 2 */
printf ("LOG517(%f) = %f\n", x, y);
}
|
|
|