Develop common mathematical functions for iOS

Source: Internet
Author: User
Tags acos asin hypot

1. trigonometric Functions
Double sin (double); sine
Double cos (double); cosine
Double Tan (double); tangent
2. Inverse trigonometric function
Double asin (double); the result is between [-PI/2, PI/2].
Double ACOs (double); the result is between [0, Pi]
Double atan (double); returns an arc tangent (Main Value). The result is between [-PI/2, PI/2].
Double atan2 (double, double); returns an arc tangent (an integer value) between [-Pi, Pi]
3. Hyperbolic trigonometric Functions
Double sinh (double );
Double cosh (double );
Double Tanh (double );
4. exponent and logarithm
Double exp (double); Calculate the power of natural number E
Double SQRT (double); Square
Double Log (double); logarithm Based on E
Double log10 (double); base-10 logarithm
Double POW (Double X, Double Y); Calculate the Power Y of the base number x
Float powf (float X, float y); consistent with pow, only the input and output are floating point numbers.
5. Integer
Double Ceil (double); rounded up
Double floor (double); remove the integer
6. Absolute Value
Double FABS (double); returns the absolute value.
Double cabs (struct complex znum); returns the absolute value of the plural.
7. Standard floating point number
Double frexp (double F, int * P); Standard floating point number, F = x * 2 ^ P, known f x, P (x between [0.5, 1])
Double ldexp (Double X, int P); opposite to frexp, we know that X and P evaluate F
8. Integer and remainder
Double MODF (double, double *); returns the integer part of the parameter through the pointer and returns the fractional part
Double fmod (double, double); returns the remainder of the two parameters.
9. Others
Double hypot (Double X, Double Y)
Double ldexp (Double X, int exponent); Calculate the power of x * (2)
Double poly (Double X, int degree, double coeffs []); polynomial calculation
NT matherr (struct exception * E); mathematical error calculation Program

Where is math. h stored? That is C function library: enter a mathematical function, and double-click this function --> right-click and use jump to definition to jump to this header file --> right-click show in finder, you will know where the header file is.

1. trigonometric Functions
Double sin (double); sine
Double cos (double); cosine
Double Tan (double); tangent
2. Inverse trigonometric function
Double asin (double); the result is between [-PI/2, PI/2].
Double ACOs (double); the result is between [0, Pi]
Double atan (double); returns an arc tangent (Main Value). The result is between [-PI/2, PI/2].
Double atan2 (double, double); returns an arc tangent (an integer value) between [-Pi, Pi]
3. Hyperbolic trigonometric Functions
Double sinh (double );
Double cosh (double );
Double Tanh (double );
4. exponent and logarithm
Double exp (double); Calculate the power of natural number E
Double SQRT (double); Square
Double Log (double); logarithm Based on E
Double log10 (double); base-10 logarithm
Double POW (Double X, Double Y); Calculate the Power Y of the base number x
Float powf (float X, float y); consistent with pow, only the input and output are floating point numbers.
5. Integer
Double Ceil (double); rounded up
Double floor (double); remove the integer
6. Absolute Value
Double FABS (double); returns the absolute value.
Double cabs (struct complex znum); returns the absolute value of the plural.
7. Standard floating point number
Double frexp (double F, int * P); Standard floating point number, F = x * 2 ^ P, known f x, P (x between [0.5, 1])
Double ldexp (Double X, int P); opposite to frexp, we know that X and P evaluate F
8. Integer and remainder
Double MODF (double, double *); returns the integer part of the parameter through the pointer and returns the fractional part
Double fmod (double, double); returns the remainder of the two parameters.
9. Others
Double hypot (Double X, Double Y)
Double ldexp (Double X, int exponent); Calculate the power of x * (2)
Double poly (Double X, int degree, double coeffs []); polynomial calculation
NT matherr (struct exception * E); mathematical error calculation Handler

Where is math. h stored? That is C function library: enter a mathematical function, and double-click this function --> right-click and use jump to definition to jump to this header file --> right-click show in finder, you will know where the header file is.

Related Article

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.