reference-en icon indicating copy to clipboard operation
reference-en copied to clipboard

Updated the documentation of the trigonometry functions.

Open jfjlaros opened this issue 2 years ago • 3 comments

All three functions have the following signature double (*)(double). This is now reflected in the documentation.

jfjlaros avatar Jul 22 '22 12:07 jfjlaros

Hi @jfjlaros. Thanks for your contribution. I was able to verify this is correct for the AVR boards:

https://www.nongnu.org/avr-libc/user-manual/group__avr__math.html#func-members

However, it is not so clear to me for the other official Arduino boards architectures, which use the functions from cmath of the C++ Standard Library:

https://en.cppreference.com/w/cpp/header/cmath

It seems these templates could have either parameter type according to the type of the argument. Did I interpret it incorrectly?

per1234 avatar Aug 12 '22 23:08 per1234

Hmm, interesting.

It seems that these functions are overloaded as float (*)(float) and long double (*)(long double) and additionally, there is a template that checks whether the parameter is of an integer type, in which case the result will be of type double, e.g., double (*)(int).

jfjlaros avatar Aug 13 '22 07:08 jfjlaros

So, what to do?

Can we document the behaviour for the AVR boards and mention that non-AVR boards (may) use the standard library (which arguably should not be documented here)?

jfjlaros avatar Aug 01 '23 07:08 jfjlaros