In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what is the commonly used mathematical function in C language, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.
Mathematical function
Mathematical operation is a frequently used form of operation in computer programs. in addition to the basic arithmetic operators, C language provides nearly 100 standard functions of commonly used mathematical operations in its standard function library to facilitate the use of programs. This section introduces several commonly used mathematical functions. For more mathematical functions, please see Appendix and other materials. Most mathematical function prototypes are declared in the header file math.h and are programmed with the following file containing instructions at the beginning of the program:
# include
Commonly used mathematical functions
1. Commonly used absolute value class functions
Int abs (int n) finds the absolute value of int type data, which is declared in stdlib.h
Double fabs (double n) to find the absolute value of double type data
two。 Commonly used trigonometric functions
Double sin (double x) to find the value of sine function
Double cos (double x) calculates cosine function values
3. Exponential, logarithmic and square root functions
Double pow (double x, double y) finds the y power of x, that is, xy
Double log (double x) to find the natural logarithm of x
Double log10 (double x) to find the base 10 logarithm of x
Double sqrt (double x) to find the square root of x
The logical structure of the program
A C program is composed of two parts: the data structure and the algorithm, in which the data structure is used to describe the data processed in the program, and the algorithm is used to describe the data processing method.
The description of data is realized by the definition of data type, and the basic implementation unit of algorithm description is C sentence.
Thank you for reading this article carefully. I hope the article "what are the mathematical functions commonly used in C language" shared by the editor will be helpful to everyone? at the same time, I also hope that you will support and pay attention to the industry information channel. more related knowledge is waiting for you 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.