Get the App
SLTechnology News&Howtos  ›  Development  › 

Summary of Mathematical functions in C++

Shulou Source: shulou.com Published: 2022-06-03 14:17:11 09月29日 Update

This article mainly explains "the summary of mathematical functions in C++". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn the "summary of mathematical functions in C++".

Math.h mathematical function library, the specific implementation of some mathematical formulas is put in math.h, specifically:

1 trigonometric function

Double sin (double)

Double cos (double)

Double tan (double)

2 inverse trigonometric function

Double asin (double); the result is between [- PI/2, PI/2]

Double acos (double); result is between [0, PI]

Double atan (double); arc tangent (principal value), the result is between [- PI/2, PI/2]

Double atan2 (double, double); arc tangent (integer value), the result is between [- PI/2, PI/2]

3 hyperbolic trigonometric function

Double sinh (double)

Double cosh (double)

Double tanh (double)

4 index and logarithm

Double exp (double)

Double pow (double, double)

Double sqrt (double)

Double log (double); logarithm based on e

Double log10 (double); natural logarithmic function in C++: log (N) has a base of 10: log10 (N), but there is no function with a base of 2, but it can be solved by the bottom-changing formula: log2 (N) = log10 (N) / log10 (2).

5 rounding

Double ceil (double)

Double floor (double); remove the whole

6 absolute value

Double fabs (double)

7 standardized floating point numbers

Double frexp (double f, int * p); standardized floating point number, f = x * 2 ^ p, known f to x, p (x between [0.5,1])

Double ldexp (double x, int p); contrary to frexp, known x, p find f

8 rounding and remainder

Double modf (double, double*); returns the integer part of the parameter through the pointer and returns the decimal part

Double fmod (double, double); returns the remainder of the division of two parameters

Source: "C & C++ Code Capsules"

9 square root

Sqrt

At this point, I believe you have a deeper understanding of the "summary of mathematical functions in C++". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Functions mathematics Cumulative functions results logarithms trigonometric functions formulas contents parameters standards tangents points parts triangles learning standardization practicality deeper remainder interest Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Huawei Shulou Tech Info Docker Redmi