You are here

math.h

floor function

Floor function returns the greatest integer not greater than x. For example, if the input is 2.25 then the output will be 2.00.

Declaration: double floor(double x);

C programming code for floor

#include <stdio.h>
#include <math.h>

log10

log10 function returns common logarithm (base is 10) of a number.

Declaration: double log10(double number);

C programming code for log10

#include <stdio.h>
#include <math.h>

sqrt in C

sqrt in C

Function sqrt in C returns the square root of a number. To use it, include the "math.h" header file in the program.

Declaration: double sqrt(double);

Square root in C using sqrt function

#include <stdio.h>
#include <math.h>

log function in C

log function returns natural logarithm (base = e) of a number, where e is the exponential number.

Declaration: double log(double);

C program to find logarithm of a number

#include <stdio.h>
#include <math.h>

pow function in C

pow function returns x raised to the power y, where x and y are variables of the double data type.

Declaration: double pow(double, double);

Function pow in C language

#include <stdio.h>
#include <math.h>

abs in C

abs (isn't a function but a macro) is used for calculating the absolute value of a number.

abs function in C language

#include <stdio.h>
#include <math.h>
Subscribe to RSS - math.h