© Peter Van Weert and Marc Gregoire 2019
Peter Van Weert and Marc GregoireC++17 Standard Library Quick Referencehttps://doi.org/10.1007/978-1-4842-4923-9_1

1. Numerics and Math

Peter Van Weert1  and Marc Gregoire2
(1)
Kessel-Lo, Belgium
(2)
Meldert, Belgium
 

Common Mathematical Functions <cmath>

The <cmath> header defines an extensive collection of common math functions in the std namespace. Unless otherwise specified, all functions are overloaded to accept all standard numerical types, with the following rules for determining the return type:
  • If all arguments are float, the return type is float as well. Analogous for double and long  double inputs.

  • If mixed types or integers are passed, these numbers are converted to double, and a double is returned as ...

Get C++17 Standard Library Quick Reference: A Pocket Guide to Data Structures, Algorithms, and Functions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.