VC ++ mathematical functions

Source: Internet
Author: User
Tags mathematical functions
Math. H, stdlib. H, String. H, float. h.
Int ABS (int I) returns the absolute value of the integer parameter I.
Double cabs (struct complex znum) returns the absolute value of the plural znum
Double FABS (Double X) returns the absolute value of the double-precision parameter X.
Long labs (long n) returns the absolute value of the long integer parameter n.
Double exp (Double X) returns the value of the exponential function ex.
Double frexp (double value, int * eptr) returns the value of X in value = x * 2n, and N is stored in eptr.
Double ldexp (double value, int exp); returns the value * 2exp
Double Log (Double X) returns the value of logex
Double log10 (Double X) returns the value of log10x
Double POW (Double X, Double Y) returns the value of XY
Double pow10 (INT p) returns the value of 10 p
Double SQRT (Double X) returns the value of + √ X.
Double ACOs (Double X) returns the arc cosine cos-1 (x) value of X, which is a radian
Double asin (Double X) returns the arc sin-1 (x) value of X, which is a radian.
Double atan (Double X) returns the arc tangent Tan-1 (x) value of X, and X is a radian
Double atan2 (Double Y, double X) returns the arc tangent Tan-1 (x) value of Y/X, and the X of Y is a radian
Double cos (Double X) returns the cosine cos (x) value of X, which is a radian.
Double sin (Double X) returns the sine sin (x) value of X, which is a radian.
Double Tan (Double X) returns the tangent Tan (x) of X, which is a radian.
Double cosh (Double X) returns the hyperbolic cosine cosh (x) value of X, which is a radian.
Double sinh (Double X) returns the hyperbolic sinh (x) value of X, which is a radian.
Double Tanh (Double X) returns the hyperbolic tangent Tanh (x) value of X, which is a radian
Double hypot (Double X, Double Y) returns the length (z) of the oblique side of the right triangle ),
X and Y are the length of the right corner. Z2 = x2 + y2
Double Ceil (Double X) returns the smallest integer not less than X
Double floor (Double X) returns the maximum integer not greater than X.
Void srand (unsigned seed) initialize the random number generator
Int rand () generates a random number and returns this number.
Double poly (Double X, int N, double C []) generates a polynomial from the Parameter
Double MODF (double value, double * iptr) splits the double precision value into the ending number and order.
Double fmod (Double X, Double Y) returns the remainder of x/y.
Double frexp (double value, int * eptr) divides the double-precision value into the ending number and order.
Double atof (char * nptr) converts the string nptr to a floating point number and returns this floating point number.
Double atoi (char * nptr) converts the string nptr to an integer and returns this integer.
Double atol (char * nptr) converts the string nptr into a growth integer and returns this integer
Char * ECVT (double value, int ndigit, int * decpt, int * sign)
Converts a floating point value to a string and returns the string.
Char * fcvt (double value, int ndigit, int * decpt, int * sign)
Converts a floating point value to a string and returns the string.
Char * gcvt (double value, int ndigit, char * BUF)
Converts a number value to a string and saves it in the Buf, and returns the pointer of the Buf.
Char * ultoa (unsigned long value, char * string, int Radix)
Converts an unsigned integer value to a string and returns the string. Radix is the base number used for conversion.
Char * ltoa (long value, char * string, int Radix)
Converts a long integer value to a string and returns the string. Radix is the base number used for conversion.
Char * ITOA (INT value, char * string, int Radix)
Converts an integer value to a string and saves it to a string. Radix is the base number used for conversion.
Double atof (char * nptr) converts the string nptr to the double-precision number, and returns this number. The error returns 0.
Int atoi (char * nptr) converts the string nptr to an integer and returns this number. The error returns 0.
Long atol (char * nptr) converts the string nptr into a growth integer and returns this number. The error returns 0.
Double strtodd (char * STR, char ** endptr) converts a string STR into a double-precision number and returns this number,
Long strtol (char * STR, char ** endptr, int base) converts string STR into a growth integer,
And return this number,
Int matherr (struct exception * E)
Function for returning information when a user modifies a mathematical error (not required)
Double _ matherr (_ mexcep why, char * Fun, double * arg1p,
Double * arg2p, double retval)
Function for returning information when a user modifies a mathematical error (not required)
Unsigned int _ clear87 () clears the floating point status word and returns the original floating point status
Void _ fpreset () re-initialize the floating point mathematical package
Unsigned int _ status87 () returns the floating point status word

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.