📄 math.html
字号:
if <CODE>1 < |x|</CODE>.</P><H2><A NAME="atan"><CODE>atan</CODE></A>,<A NAME="atanf"><CODE>atanf</CODE></A>,<A NAME="atanl"><CODE>atanl</CODE></A></H2><PRE>double <B>atan</B>(double x);float <B>atan</B>(float x); <B>[C++ only]</B>long double <B>atan</B>(long double x); <B>[C++ only]</B>float <B>atanf</B>(float x); <B>[required with C99]</B>long double <B>atanl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the angle whose tangent is <CODE>x</CODE>, inthe range [-pi/2, +pi/2] radians.</P><H2><A NAME="atan2"><CODE>atan2</CODE></A>,<A NAME="atan2f"><CODE>atan2f</CODE></A>,<A NAME="atan2l"><CODE>atan2l</CODE></A></H2><PRE>double <B>atan2</B>(double y, double x);float <B>atan2</B>(float y, float x); <B>[C++ only]</B>long double <B>atan2</B>(long double y, long double x); <B>[C++ only]</B>float <B>atan2f</B>(float y, float x); <B>[required with C99]</B>long double <B>atan2l</B>(long double y, long double x); <B>[required with C99]</B></PRE><P>The function returns the angle whose tangent is <CODE>y/x</CODE>,in the full angular range [-pi, +pi] radians. A domain error may occurif both <CODE>x</CODE> and <CODE>y</CODE> are zero.</P><H2><A NAME="ceil"><CODE>ceil</CODE></A>,<A NAME="ceilf"><CODE>ceilf</CODE></A>,<A NAME="ceill"><CODE>ceill</CODE></A></H2><PRE>double <B>ceil</B>(double x);float <B>ceil</B>(float x); <B>[C++ only]</B>long double <B>ceil</B>(long double x); <B>[C++ only]</B>float <B>ceilf</B>(float x); <B>[required with C99]</B>long double <B>ceill</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the smallest integer value not less than<CODE>x</CODE>.</P><H2><A NAME="cos"><CODE>cos</CODE></A>,<A NAME="cosf"><CODE>cosf</CODE></A>,<A NAME="cosl"><CODE>cosl</CODE></A></H2><PRE>double <B>cos</B>(double x);float <B>cos</B>(float x); <B>[C++ only]</B>long double <B>cos</B>(long double x); <B>[C++ only]</B>float <B>cosf</B>(float x); <B>[required with C99]</B>long double <B>cosl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the cosine of <CODE>x</CODE>.If <CODE>x</CODE> is large the value returnedmight not be meaningful, but the function reports no error.</P><H2><A NAME="cosh"><CODE>cosh</CODE></A>,<A NAME="coshf"><CODE>coshf</CODE></A>,<A NAME="coshl"><CODE>coshl</CODE></A></H2><PRE>double <B>cosh</B>(double x);float <B>cosh</B>(float x); <B>[C++ only]</B>long double <B>cosh</B>(long double x); <B>[C++ only]</B>float <B>coshf</B>(float x); <B>[required with C99]</B>long double <B>coshl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the hyperbolic cosine of <CODE>x</CODE>.</P><H2><A NAME="exp"><CODE>exp</CODE></A>,<A NAME="expf"><CODE>expf</CODE></A>,<A NAME="expl"><CODE>expl</CODE></A></H2><PRE>double <B>exp</B>(double x);float <B>exp</B>(float x); <B>[C++ only]</B>long double <B>exp</B>(long double x); <B>[C++ only]</B>float <B>expf</B>(float x); <B>[required with C99]</B>long double <B>expl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the exponential of <CODE>x</CODE>,e^<CODE>x</CODE>.</P><H2><A NAME="floor"><CODE>floor</CODE></A>,<A NAME="floorf"><CODE>floorf</CODE></A>,<A NAME="floorl"><CODE>floorl</CODE></A></H2><PRE>double <B>floor</B>(double x);float <B>floor</B>(float x); <B>[C++ only]</B>long double <B>floor</B>(long double x); <B>[C++ only]</B>float <B>floorf</B>(float x); <B>[required with C99]</B>long double <B>floorl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the largest integer value not greater than<CODE>x</CODE>.</P><H2><A NAME="fmod"><CODE>fmod</CODE></A>,<A NAME="fmodf"><CODE>fmodf</CODE></A>,<A NAME="fmodl"><CODE>fmodl</CODE></A></H2><PRE>double <B>fmod</B>(double x, double y);float <B>fmod</B>(float x, float y); <B>[C++ only]</B>long double <B>fmod</B>(long double x, long double y); <B>[C++ only]</B>float <B>fmodf</B>(float x, float y); <B>[required with C99]</B>long double <B>fmodl</B>(long double x, long double y); <B>[required with C99]</B></PRE><P>The function returns the remainder of <CODE>x/y</CODE>,which is defined as follows:</P><UL><LI>If <CODE>y</CODE> is zero,the function either reports a domain error or simply returns zero.</LI><LI>Otherwise, the function determines the unique signed integer value<CODE>i</CODE> such that the returned value <CODE>x - i * y</CODE> has thesame sign as <CODE>x</CODE> and magnitude less than <CODE>|y|</CODE>.</LI></UL><H2><A NAME="frexp"><CODE>frexp</CODE></A>,<A NAME="frexpf"><CODE>frexpf</CODE></A>,<A NAME="frexpl"><CODE>frexpl</CODE></A></H2><PRE>double <B>frexp</B>(double x, int *pexp);float <B>frexp</B>(float x, int *pexp); <B>[C++ only]</B>long double <B>frexp</B>(long double x, int *pexp); <B>[C++ only]</B>float <B>frexpf</B>(float x, int *pexp); <B>[required with C99]</B>long double <B>frexpl</B>(long double x, int *pexp); <B>[required with C99]</B></PRE><P>The function determines a fraction <CODE>frac</CODE> and an exponent integer<CODE>ex</CODE> that represent the value of <CODE>x</CODE>.It returns the value <CODE>frac</CODE> and stores the integer<CODE>ex</CODE> in <CODE>*pexp</CODE>, such that:<UL><LI><CODE>|frac|</CODE> is in the interval [1/2, 1) or is zero</LI><LI><CODE>x == frac * 2^ex</CODE></LI></UL><P>If <CODE>x</CODE> is zero, <CODE>*pexp</CODE> is also zero.</P><H2><A NAME="HUGE_VAL"><CODE>HUGE_VAL</CODE></A></H2><PRE>#define <B>HUGE_VAL</B> <I><double rvalue></I></PRE><P>The macro yields the <I>double</I> value returned by some functionson a range error. The value can be a representation of infinity.</P><H2><A NAME="ldexp"><CODE>ldexp</CODE></A>,<A NAME="ldexpf"><CODE>ldexpf</CODE></A>,<A NAME="ldexpl"><CODE>ldexpl</CODE></A></H2><PRE>double <B>ldexp</B>(double x, int ex);float <B>ldexp</B>(float x, int ex); <B>[C++ only]</B>long double <B>ldexp</B>(long double x, int ex); <B>[C++ only]</B>float <B>ldexpf</B>(float x, int ex); <B>[required with C99]</B>long double <B>ldexpl</B>(long double x, int ex); <B>[required with C99]</B></PRE><P>The function returns <CODE>x * 2^ex</CODE>.</P><H2><A NAME="log"><CODE>log</CODE></A>,<A NAME="logf"><CODE>logf</CODE></A>,<A NAME="logl"><CODE>logl</CODE></A></H2><PRE>double <B>log</B>(double x);float <B>log</B>(float x); <B>[C++ only]</B>long double <B>log</B>(long double x); <B>[C++ only]</B>float <B>logf</B>(float x); <B>[required with C99]</B>long double <B>logl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the natural logarithm of <CODE>x</CODE>.A domain error occurs if <CODE>x < 0</CODE>.</P><H2><A NAME="log10"><CODE>log10</CODE></A>,<A NAME="log10f"><CODE>log10f</CODE></A>,<A NAME="log10l"><CODE>log10l</CODE></A></H2><PRE>double <B>log10</B>(double x);float <B>log10</B>(float x); <B>[C++ only]</B>long double <B>log10</B>(long double x); <B>[C++ only]</B>float <B>log10f</B>(float x); <B>[required with C99]</B>long double <B>log10l</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the base-10 logarithm of <CODE>x</CODE>.A domain error occurs if <CODE>x < 0</CODE>.</P><H2><A NAME="modf"><CODE>modf</CODE></A>,<A NAME="modff"><CODE>modff</CODE></A>,<A NAME="modfl"><CODE>modfl</CODE></A></H2><PRE>double <B>modf</B>(double x, double *pint);float <B>modf</B>(float x, float *pint); <B>[C++ only]</B>long double <B>modf</B>(long double x, long double *pint); <B>[C++ only]</B>float <B>modff</B>(float x, float *pint); <B>[required with C99]</B>long double <B>modfl</B>(long double x, long double *pint); <B>[required with C99]</B></PRE><P>The function determines an integer <CODE>i</CODE> plus a fraction<CODE>frac</CODE> that represent the value of <CODE>x</CODE>.It returns the value <CODE>frac</CODE> and stores the integer<CODE>i</CODE> in <CODE>*pint</CODE>, such that:</P><UL><LI><CODE>x == frac + i</CODE></LI><LI><CODE>|frac|</CODE> is in the interval [0, 1)</LI><LI>both <CODE>frac</CODE> and <CODE>i</CODE> have thesame sign as <CODE>x</CODE></LI></UL><H2><A NAME="pow"><CODE>pow</CODE></A>,<A NAME="powf"><CODE>powf</CODE></A>,<A NAME="powl"><CODE>powl</CODE></A></H2><PRE>double <B>pow</B>(double x, double y);float <B>pow</B>(float x, float y); <B>[C++ only]</B>long double <B>pow</B>(long double x, long double y); <B>[C++ only]</B>double <B>pow</B>(double x, int y); <B>[C++ only]</B>float <B>pow</B>(float x, int y); <B>[C++ only]</B>long double <B>pow</B>(long double x, int y); <B>[C++ only]</B>float <B>powf</B>(float x, float y); <B>[required with C99]</B>long double <B>powl</B>(long double x, long double y); <B>[required with C99]</B></PRE><P>The function returns <CODE>x</CODE> raised to the power <CODE>y</CODE>,<CODE>x^y</CODE>.</P><H2><A NAME="sin"><CODE>sin</CODE></A>,<A NAME="sinf"><CODE>sinf</CODE></A>,<A NAME="sinl"><CODE>sinl</CODE></A></H2><PRE>double <B>sin</B>(double x);float <B>sin</B>(float x); <B>[C++ only]</B>long double <B>sin</B>(long double x); <B>[C++ only]</B>float <B>sinf</B>(float x); <B>[required with C99]</B>long double <B>sinl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the sine of <CODE>x</CODE>.If <CODE>x</CODE> is largethe value returned might not be meaningful, butthe function reports no error.</P><H2><A NAME="sinh"><CODE>sinh</CODE></A>,<A NAME="sinhf"><CODE>sinhf</CODE></A>,<A NAME="sinhl"><CODE>sinhl</CODE></A></H2><PRE>double <B>sinh</B>(double x);float <B>sinh</B>(float x); <B>[C++ only]</B>long double <B>sinh</B>(long double x); <B>[C++ only]</B>float <B>sinhf</B>(float x); <B>[required with C99]</B>long double <B>sinhl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the hyperbolic sine of <CODE>x</CODE>.</P><H2><A NAME="sqrt"><CODE>sqrt</CODE></A>,<A NAME="sqrtf"><CODE>sqrtf</CODE></A>,<A NAME="sqrtl"><CODE>sqrtl</CODE></A></H2><PRE>double <B>sqrt</B>(double x);float <B>sqrt</B>(float x); <B>[C++ only]</B>long double <B>sqrt</B>(long double x); <B>[C++ only]</B>float <B>sqrtf</B>(float x); <B>[required with C99]</B>long double <B>sqrtl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the real square root of <CODE>x</CODE>,<CODE>x^(1/2)</CODE>. A domain error occurs if <CODE>x < 0</CODE>.</P><H2><A NAME="tan"><CODE>tan</CODE></A>,<A NAME="tanf"><CODE>tanf</CODE></A>,<A NAME="tanl"><CODE>tanl</CODE></A></H2><PRE>double <B>tan</B>(double x);float <B>tan</B>(float x); <B>[C++ only]</B>long double <B>tan</B>(long double x); <B>[C++ only]</B>float <B>tanf</B>(float x); <B>[required with C99]</B>long double <B>tanl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the tangent of <CODE>x</CODE>.If <CODE>x</CODE> is large the value returnedmight not be meaningful,but the function reports no error.</P><H2><A NAME="tanh"><CODE>tanh</CODE></A>,<A NAME="tanhf"><CODE>tanhf</CODE></A>,<A NAME="tanhl"><CODE>tanhl</CODE></A></H2><PRE>double <B>tanh</B>(double x);float <B>tanh</B>(float x); <B>[C++ only]</B>long double <B>tanh</B>(long double x); <B>[C++ only]</B>float <B>tanhf</B>(float x); <B>[required with C99]</B>long double <B>tanhl</B>(long double x); <B>[required with C99]</B></PRE><P>The function returns the hyperbolic tangent of <CODE>x</CODE>.</P><HR><P>See also the<B><A HREF="index.html#Table of Contents">Table of Contents</A></B> and the<B><A HREF="_index.html">Index</A></B>.</P><P><I><A HREF="crit_pb.html">Copyright</A> © 1989-2002by P.J. Plauger and Jim Brodie. All rights reserved.</I></P><!--V4.01:1125--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -