Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Where is the documentation for math functions?

  1. #1
    Junior Member
    Join Date
    Jul 2022
    Posts
    11

    Where is the documentation for math functions?

    Hi,

    I'd like to know where the math functions are documented.
    I found a list here: https://www.arduino.cc/reference/en/
    But this list is incomplete. For example atan(), atan2(), log(), asin(), acos() are missing in the list, but they are available. I wonder what else functions exist.

    Thanks,
    Michael

  2. #2
    Arduino/Teensy code is compiled using a GCC C++ compiler, so you can just consult the C++ documentation: https://en.cppreference.com/w/cpp/he...math#Functions

  3. #3
    Junior Member
    Join Date
    Jul 2022
    Posts
    11
    thank you!

    Michael

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,787
    Some math functions beyond the C++ library follow Arduino's documentation. map() and constrain() are the most commonly used.

    https://www.arduino.cc/reference/en/...ions/math/map/

    https://www.arduino.cc/reference/en/...ath/constrain/

    However, Teensy's map() function has a (more or less undocumented) extension where it will use floating point math if the input variable is float or double. But when the input is an integer, integer math is used as "Notes & Warnings" says on Arduino's documentation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •