Skip to content

Updated the documentation of the trigonometry functions.#900

Open
jfjlaros wants to merge 1 commit into
arduino:masterfrom
jfjlaros:patch-1
Open

Updated the documentation of the trigonometry functions.#900
jfjlaros wants to merge 1 commit into
arduino:masterfrom
jfjlaros:patch-1

Conversation

@jfjlaros

Copy link
Copy Markdown

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

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

per1234 commented Aug 12, 2022

Copy link
Copy Markdown
Collaborator

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 per1234 added bug Waiting for feedback More information must be provided before we can proceed labels Aug 12, 2022
@per1234 per1234 self-assigned this Aug 12, 2022
@jfjlaros

Copy link
Copy Markdown
Author

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

jfjlaros commented Aug 1, 2023

Copy link
Copy Markdown
Author

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)?

@per1234 per1234 removed their assignment Sep 23, 2025
@CLAassistant

CLAassistant commented Mar 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Waiting for feedback More information must be provided before we can proceed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants