Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of Mathematical functions in C++

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report