0% found this document useful (0 votes)
32 views

C Math (Math.h) Library Reference

Uploaded by

safwan448955
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

C Math (Math.h) Library Reference

Uploaded by

safwan448955
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

 Tutorials  Exercises  Services   Sign Up Log in

HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C

C math (math.h) Library


❮ Previous Next ❯

C Math Functions
The <math.h> library has many functions that allow you to perform mathematical
tasks on numbers.

Function Description

acos(x) Returns the arccosine of x, in radians

acosh(x) Returns the hyperbolic arccosine of x

asin(x) Returns the arcsine of x, in radians

asinh(x) Returns the hyperbolic arcsine of x

atan(x) Returns the arctangent of x as a numeric value between -PI/2 and


PI/2 radians

atan2(y, x) Returns the angle theta from the conversion of rectangular


coordinates (x, y) to polar coordinates (r, theta)

atanh(x) Returns the hyperbolic arctangent of x

cbrt(x) Returns the cube root of x

ceil(x) Returns the value of x rounded up to its nearest integer

copysign(x, Returns the first floating point x with the sign of the second
y) floating point y

cos(x) Returns the cosine of x (x is in radians)


cosh(x)Tutorials  Returns the hyperbolic cosine of x
Exercises  Services   Sign Up Log in
exp(x) Returns the value of Ex
HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
exp2(x) Returns the value of 2x

expm1(x) Returns ex-1

erf(x) Returns the value of the error function at x

erfc(x) Returns the value of the complementary error function at x

fabs(x) Returns the absolute value of x

fdim(x) Returns the positive difference between x and y

floor(x) Returns the value of x rounded down to its nearest integer

fma(x, y, z) Returns x*y+z without losing precision

fmax(x, y) Returns the highest value of a floating x and y

fmin(x, y) Returns the lowest value of a floating x and y

fmod(x, y) Returns the floating point remainder of x/y

frexp(x, y) With x expressed as m*2n, returns the value of m (a value


between 0.5 and 1.0) and writes the value of n to the memory at
the pointer y

hypot(x, y) Returns sqrt(x2 +y2) without intermediate overflow or underflow

ilogb(x) Returns the integer part of the floating-point base logarithm of x

ldexp(x, y) Returns x*2y

lgamma(x) Returns the logarithm of the absolute value of the gamma


function at x

llrint(x) Rounds x to a nearby integer and returns the result as a long long
integer

llround(x) Rounds x to the nearest integer and returns the result as a long
long integer

log(x) Returns the natural logarithm of x

log10(x) Returns the base 10 logarithm of x

log1p(x) Returns the natural logarithm of x+1


log2(x)Tutorials  Returns the base 2 logarithm of the absolute
Exercises  Services   value of x
Sign Up Log in
logb(x) Returns the floating-point base logarithm of the absolute value of
HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
x

lrint(x) Rounds x to a nearby integer and returns the result as a long


integer

lround(x) Rounds x to the nearest integer and returns the result as a long
integer

modf(x, y) Returns the decimal part of x and writes the integer part to the
memory at the pointer y

nan(s) Returns a NaN (Not a Number) value

nearbyint(x) Returns x rounded to a nearby integer

nextafter(x, Returns the closest floating point number to x in the direction of y


y)

nexttoward(x, Returns the closest floating point number to x in the direction of y


y)

pow(x, y) Returns the value of x to the power of y

remainder(x, Return the remainder of x/y rounded to the nearest integer


y)

remquo(x, y, Calculates x/y rounded to the nearest integer, writes the result to
z) the memory at the pointer z and returns the remainder.

rint(x) Returns x rounded to a nearby integer

round(x) Returns x rounded to the nearest integer

scalbln(x, y) Returns x*Ry (R is usually 2)

scalbn(x, y) Returns x*Ry (R is usually 2)

sin(x) Returns the sine of x (x is in radians)

sinh(x) Returns the hyperbolic sine of x

sqrt(x) Returns the square root of x

tan(x) Returns the tangent of x (x is in radians)

tanh(x) Returns the hyperbolic tangent of x

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy