21 Aralık 2010 Salı

c programlamada matematik fonksiyonlar

Yorum Bırak
some mathematical functions in c language

acos
#include <cmath>
float acos(float arg);
double acos(double arg);
long double acos(long double arg);
The acos() function returns the arc cosine of arg. The argument to acos() must be in
the range –1 to 1; otherwise a domain error will occur.
Related functions are asin() , atan() , atan2() , sin() , cos() , tan() , sinh() , cosh() ,
and tanh().
asin
#include <cmath>
float asin(float arg);
double asin(double arg);
long double asin(long double arg);
The asin() function returns the arc sine of arg. The argument to asin() must be in
the range –1 to 1; otherwise a domain error will occur.
Related functions are acos() , atan() , atan2() , sin() , cos() , tan() , sinh() , cosh() ,
and tanh() .

atan
#include <cmath>
float atan(float arg);
double atan(double arg);
long double atan(long double arg);
The atan() function returns the arc tangent of arg.
Related functions are asin() , acos() , atan2() , tan() , cos() , sin() , sinh() , cosh() ,
and tanh() .

atan2
#include <cmath>
float atan2(float y, float x);
double atan2(double y, double x);
long double atan2(long double y, long double x);
The atan2() function returns the arc tangent of y/x. It uses the signs of its
arguments to compute the quadrant of the return value.
Related functions are asin() , acos() , atan() , tan() , cos() , sin() , sinh() , cosh() ,
and tanh() .

ceil
#include <cmath>
float ceil(float num);
double ceil(double num);
long double ceil(long double num);

The ceil() function returns the smallest integer (represented as a floating-point
value) not less than num. For example, given 1.02, ceil() would return 2.0. Given –1.02,
ceil() would return –1.
Related functions are floor() and fmod() .

cos
#include <cmath>
float cos(float arg);
double cos(double arg);
long double cos(long double arg);
The cos() function returns the cosine of arg. The value of arg must be in radians.
Related functions are asin() , acos() , atan2() , atan() , tan() , sin() , sinh() , cos() ,
and tanh() .



cosh
#include <cmath>
float cosh(float arg);
double cosh(double arg);
long double cosh(long double arg);
The cosh() function returns the hyperbolic cosine of arg.
Related functions are asin() , acos() , atan2() , atan() , tan() , sin() , cosh() , and
tanh().

exp
#include <cmath>
float exp(float arg);
double exp(double arg);
long double exp(long double arg);
The exp() function returns the natural logarithm base e raised to the arg power.
A related function is log() .

fabs
#include <cmath>
float fabs(float num);
double fabs(double num);
long double fabs(long double num);
The fabs() function returns the absolute value of num.
A related function is abs() .
floor
#include <cmath>
float floor(float num);
double floor(double num);
long double floor(long double num);
The floor() function returns the largest integer (represented as a floating-point
value) not greater than num. For example, given 1.02, floor() would return 1.0. Given
–1.02, floor() would return –2.0.
Related functions are fceil() and fmod() .
fmod
#include <cmath>
float fmod(float x, float y);
double fmod(double x, double y);
long double fmod(long double x, long double y);
The fmod() function returns the remainder of x/y.
Related functions are ceil() , floor() , and fabs() .
frexp
#include <cmath>
float frexp(float num, int *exp);

double frexp(double num, int *exp);
long double frexp(long double num, int *exp);
The frexp() function decomposes the number num into a mantissa in the range 0.5
to less than 1, and an integer exponent such that num = mantissa * 2exp. The mantissa is
returned by the function, and the exponent is stored at the variable pointed to by exp.
A related function is ldexp() .
ldexp
#include <cmath>
float ldexp(float num, int exp);
double ldexp(double num, int exp);
long double ldexp(long double num, int exp);
The ldexp() returns the value of num * 2exp. If overflow occurs, HUGE_VAL
is returned.
Related functions are frexp() and modf() .
log
#include <cmath>
float log(float num);
double log(double num);
long double log(long double num);
The log() function returns the natural logarithm for num. A domain error occurs if
num is negative, and a range error occurs if the argument is zero.
A related function is log10() .
log10
#include <cmath>
float log10(float num);
double log10(double num);
long double log10(long double num);

The log10() function returns the base 10 logarithm for num. A domain error occurs
if num is negative, and a range error occurs if the argument is zero.
A related function is log() .


sqrt
#include <cmath>
float sqrt(float num);
double sqrt(double num);
long double sqrt(long double num);
The sqrt() function returns the square root of num. If it is called with a negative
argument, a domain error will occur.
Related functions are exp() , log() , and pow() .

0 yorum:

Yorum Gönder