C89: math commonly used functions

I. Introduction

 

II. Common functions

1. calculating an absolute value

ABS int (int x);   / / absolute value of the integer x
Double FABS (Double x); / / absolute value of the floating point number x

 

2. Calculate rounded and take the remainder

Double ceil ( Double num);   / / get the smallest integer not less than num 
Double Floor (Double x); / / obtains the maximum integer not greater than x

 

3. Calculate Triangle

 

Double SiN ( Double X);   / / sine function calculation , the sine of the angle A is its side length ratio of the length of the hypotenuse of the triangle and 
Double COS (Double X); / / calculated cosine function, x is the value in radians ( Radian * the PI / 180 [ )
Double Tan (Double X); / / calculated tangent, tangent of angle a is its side length ratio of the length of the limb and
Double hypot (Double X, Double Y); / / two known right triangle right angle side length, ask length of the hypotenuse

 

4. Calculate the inverse trigonometric

Double ASIN ( Double X);   / / sine known values of X, return value in radians Double ACOS (Double X); Double atan (Double X); Double of atan2 (Double X, Double Y); / / XY coordinates is known, returns radians [-π, π] is determined as the boundary 


 

The logarithmic and exponential calculation

Double exp ( Double x);   / / request e power of x
Double FMOD (Double x, Double Y); / / remainder integer of x / y
Double POW (Double x, Double Y); / / calculated at x base number of the power of y, i.e. x ^ y values calculated
Double sqrt (Double x); / / square root of x
Double log (Double x); / / x of the natural logarithm (ln X)

 

Guess you like

Origin www.cnblogs.com/k5bg/p/11751350.html