Standard C Math [C++ Reference]
Keywords: c,math,start
Date: 2008-12-13T06:21:49-0800

[[Standard C Math]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

# Standard C Math

abs | absolute value
acos | arc cosine
asin | arc sine
atan | arc tangent
atan2 | arc tangent, using signs to determine quadrants
ceil | the smallest integer not less than a certain value
cos | cosine
cosh | hyperbolic cosine
div | returns the quotient and remainder of a division
exp | returns “e” raised to a given power
fabs | absolute value for floating-point numbers
floor | returns the largest integer not greater than a given value
fmod | returns the remainder of a division
frexp | decomposes a number into scientific notation
labs | absolute value for long integers
ldexp | computes a number in scientific notation
ldiv | returns the quotient and remainder of a division, in long integer form
log | natural logarithm (to base e)
log10 | common logarithm (to base 10)
modf | decomposes a number into integer and fractional parts
pow | returns a given number raised to another number
sin | sine
sinh | hyperbolic sine
sqrt | square root
tan | tangent
tanh | hyperbolic tangent

##### Compiling with gcc

In order to use some of the above functions, certain versions of the gcc compiler require the math library to be explicitly linked in using the `-lm` command-line option.

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •