Hi,
I´am doing a weather station using arduino.
I need to calculate ln(x)
How do I write the code to calculate ln(x)?
Best regards
Northriver
Howto calculate ln(x) with arduino?
Re: Howto calculate ln(x) with arduino?
Re: Howto calculate ln(x) with arduino?
bastard wrote:Read the manual:
The AVR math library, which is included in your sketch by using the line
#include <math.h> // (no semicolon)
Includes a great number of useful mathematical functions, including trigonometric, and logarithmic functions.
[...]
Bye
Stefan
Re: Howto calculate ln(x) with arduino?
Northriver wrote:Thanks for reply Stefan,
But I can´t find ln(x) in the math.h library.
only:
double log (double __x)
Re: Howto calculate ln(x) with arduino?
hlantz wrote:Northriver wrote:Thanks for reply Stefan,
But I can´t find ln(x) in the math.h library.
only:
double log (double __x)
Isn't that what you're looking for?
From the math.h manual page:
double log (double __x) // natural logarithm of x
Natural logarithm of x = ln(x), right?