math库函数都有什么?

math库函数都有什么


饮歌长啸
浏览 300回答 2
2回答

慕工程0101907

4.1 sin#include <math.h>double sin(double arg);返回arg的正弦值,arg单位为弧度。4.2 cos#include <math.h>double cos(double arg);返回arg的余弦值,arg单位为弧度。4.3 tan#include <math.h>double tan(double arg);返回arg的正切值,arg单位为弧度。4.4 asin#include <math.h>double asin(double arg);返回arg的反正弦值sin-1(x),值域为[-pi/2,pi/2], 其中变元范围[-1,1]。4.5 acos#include <math.h>double acos(double arg);返回arg的反余弦值cos-1(x),值域为[0,pi], 其中变元范围[-1,1]。4.6 atan#include <math.h>double atan(double arg);返回arg的反正切值tan-1(x),值域为[-pi/2,pi/2]。4.7 atan2#include <math.h>double atan2(double a, double b);返回a/b的反正切值tan-1(a/b),值域为[-pi,pi]。4.8 sinh#include <math.h>double sinh(double arg);返回arg的双曲正弦值。4.9 cosh#include <math.h>double cosh(double arg);返回arg的双曲余弦值。4.10 tanh#include <math.h>double tanh(double arg);返回arg的双曲正切值。4.11 exp#include <math.h>double exp(double arg);返回幂函数ex。4.12 log#include <math.h>double log(double arg);返回自然对数ln(x),其中变元范围arg > 0。4.13 log10#include <math.h>double log10(double arg);返回以10为底的对数log10(x),其中变元范围arg > 0。4.14 pow#include <math.h>double pow(double x, double y);返回xy,如果x=0且y<=0或者如果x<0且y不是整数,那么产生定义域错误。4.15 sqrt#include <math.h>double sqrt(double arg);返回arg的平方根,其中变元范围arg>=0。4.16 ceil#include <math.h>double ceil(double arg);返回不小于arg的最小整数。4.17 floor#include <math.h>double floor(double arg);返回不大于arg的最大整数。4.18 fabs#include <math.h>double fabs(double arg);返回arg的绝对值|x|。4.19 ldexp#include <math.h>double ldexp(double num, int exp);返回num * 2exp。4.20 frexp#include <math.h>double frexp(double num, int *exp);把num分成一个在[1/2,1)区间的真分数和一个2的幂数。将真分数返回,幂数保存在*exp中。如果num等于0,那么这两部分均为0。4.21 modf#include <math.h>double modf(double num, double *i);把num分成整数和小数两部分,两部分均与num有同样的正负号。函数返回小数部分,整数部分保存在*i中。4.22 fmod#include <math.h>double fmod(double a, double b);
打开App,查看更多内容
随时随地看视频慕课网APP