🌐
TutorialsPoint
tutorialspoint.com › c_standard_library › math_h.htm
C Library - <math.h>
Python TechnologiesDatabasesComputer ProgrammingWeb DevelopmentJava TechnologiesComputer ScienceMobile DevelopmentBig Data & AnalyticsMicrosoft TechnologiesDevOpsLatest TechnologiesMachine LearningDigital MarketingSoftware QualityManagement Tutorials View All Categories ... The math.h header defines various mathematical functions and one macro. All the functions available in this library take double as an argument and return double as the result.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-library-math_h
C Library - math.h - GeeksforGeeks
July 23, 2025 - Note: inf is used to represent positive infinity (very large number that cannot be represented using double or float. Here is a list of some commonly used math.h library macros: Note: isgreater(x , y) may look like a function but they are defined as macros in the math.h header file and are replaced by their value in preprocessing.
People also ask

What is math.h in C?
math.h is a standard header file in C that contains many mathematical functions used for scientific and numerical calculations.
🌐
wscubetech.com
wscubetech.com › resources › c-programming › math-functions
Math Functions in C Programming (Full List With Examples)
Why do we use math.h in C?
The math.h header file provides built in mathematical functions like sqrt(), pow(), sin(), cos(), and log() that help perform complex calculations easily.
🌐
wscubetech.com
wscubetech.com › resources › c-programming › math-functions
Math Functions in C Programming (Full List With Examples)
🌐
Programiz
programiz.com › c-programming › library-function › math.h
C math.h
The C <math.h> header file declares a set of functions to perform mathematical operations such as: sqrt() to calculate the square root, log() to find natural logarithm of a number etc.
🌐
Aticleworld
aticleworld.com › home › c library math.h functions
C Library math.h functions - Aticleworld
December 30, 2023 - #include <math.h> #include <stdio.h> int main() { double data, squareRoot; printf("Enter a number: "); scanf("%lf", &data); // Compute square root of data squareRoot = sqrt(data); //print square root of data printf("Square root of %f = %f",data, squareRoot); return 0; }
🌐
Scaler
scaler.com › home › topics › math.h functions in c library
Math.h Functions in C Library| Scaler Topics
March 16, 2022 - The table summarizes the set of important math functions defined in math.h header file. The math.h header also provides a set of predefined constants/ macros summarized in the table below. Let us take a look at some simple examples and familiarize ourselves with how we can use predefined math ...
🌐
Fresh2Refresh
fresh2refresh.com › home › c programming tutorial › c – function › c – math.h library functions
C math.h library functions | C Function | Fresh2Rfresh
July 18, 2020 - “math.h” header file supports all the mathematical related functions in C language. All the arithmetic functions used in C language are given below. Click on each function name below for detail description and example programs.
🌐
W3Schools
w3schools.com › c › c_ref_math.php
C math (math.h) Library Reference
C Examples C Real-Life Examples C Exercises C Quiz C Code Challenges C Compiler C Syllabus C Study Plan C Interview Q&A C Certificate ... The <math.h> library has many functions that allow you to perform mathematical tasks on numbers.
🌐
Wikibooks
en.wikibooks.org › wiki › C_Programming › math.h
C Programming/math.h - Wikibooks, open books for an open world
February 20, 2006 - C++ also implements these functions ... in the header cmath (the C99 functions are not available in the current C++ standard, C++ 98). All functions that take or return an angle work in radians. All functions take doubles for floating-point arguments, unless otherwise specified. In C99, to work with floats or long doubles, append an f or an l to the name, respectively. Mathematical library functions ...
Find elsewhere
🌐
W3Schools
w3schools.com › c › c_math.php
C Math Functions
To use them, you must include the math.h header file in your program: ... The ceil() function rounds a number upwards to its nearest integer, and the floor() method rounds a number downwards to its nearest integer, and returns the result:
🌐
WsCube Tech
wscubetech.com › resources › c-programming › math-functions
Math Functions in C Programming (Full List With Examples)
2 weeks ago - Learn in this tutorial about math functions in C programming with simple examples. Learn how to use each function with clear syntax and practical applications.
🌐
Cardiff University
users.cs.cf.ac.uk › Dave.Marshall › C › node17.html
Mathematics: <math.h>
We give no further examples here: double acos(double x) -- Compute arc cosine of x. double asin(double x) -- Compute arc sine of x. double atan(double x) -- Compute arc tangent of x. double atan2(double y, double x) -- Compute arc tangent of y/x, using the signs of both arguments to determine ...
🌐
Wikipedia
en.wikipedia.org › wiki › C_mathematical_functions
C mathematical functions - Wikipedia
February 14, 2026 - A few more complex functions are "reserved for future use in C99". Implementations are provided by open-source projects that are not part of the standard library. The header <tgmath.h> defines a type-generic macro for each mathematical function defined in <math.h> and <complex.h>. This adds a limited support for function overloading of the mathematical functions: the same function name can be used with different types of parameters; the actual function will be selected at compile time according to the types of the parameters.
🌐
Cplusplus
cplusplus.com › reference › cmath
<cmath> (math.h)
Header <cmath> declares a set of functions to compute common mathematical operations and transformations:
🌐
PREP INSTA
prepinsta.com › home › all about c language › library function in c › math.h functions in c library
Math.h Library Functions in C | PrepInsta
January 31, 2023 - Note: To use these functions we must include math.h header file (#include<math.h>) ... #include<stdio.h> #include<math.h> int main () { double y = 16.0; printf ("square root of %.1f is %.4f.
🌐
SkillVertex
skillvertex.com › blog › c-library-math-h-functions
C Library Math.h Functions
May 10, 2024 - // C code to illustrate // the use of ceil function. #include <math.h> #include <stdio.h> int main() { float val1, val2, val3, val4; val1 = 1.6; val2 = 1.2; val3 = -2.8; val4 = -2.3; printf("value1 = %.1lf\n", ceil(val1)); printf("value2 = %.1lf\n", ...
🌐
Dremendo
dremendo.com › c-programming-tutorial › c-mathematical-functions
Mathematical Functions in C Programming | Dremendo
#include <stdio.h> #include <conio.h> #include <math.h> int main() { int a,b; double c; printf("Enter two integer numbers\n"); scanf("%d%d",&a,&b); c=pow(a,b); printf("Power = %lf",c); return 0; }
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_math_functions.htm
Math Functions in C
The following example shows how you can use trigonometric functions in C − · #include <stdio.h> #include <math.h> #define PI 3.14159265 int main() { double x, sn, cs, tn, val; x = 45.0; val = PI / 180; sn = sin(x*val); cs = cos(x*val); tn = tan(x*val); printf("sin(%f) : %f\n", x, sn); printf("cos(%f) : %f\n", x, cs); printf("tan(%f) : %f\n", x, tn); return(0); }
🌐
I Can Tutorials
icantutorials.com › 2023 › 04 › math.h-C-Math-Library-Functions-and-example-program.html
math.h: C Math Library Functions and example program - I Can Tutorials
STEP 1: START STEP 2: CALL ceil function ceil(number) PRINT “return value of ceil function” STEP 3: CALL floor function floor(number) PRINT “return value of floor function” STEP 4: CALL square root function sqrt(number) PRINT “return value of sqrt function” STEP 5: CALL power function pow(base & exponent) PRINT “return value of pow function” STEP 6: CALL absolute function abs(number) PRINT “return value of abs function” STEP 7: END · #include<stdio.h> #include <math.h> #include <conio.h> int main(){ printf("Demonstration of math.h library functions:"); printf("\nceil(5.3):
🌐
IncludeHelp
includehelp.com › c-programs › math-h-functions.aspx
math.h header file functions with examples in C language
This section contains library functions of math.h header file with example programs and output. Each function is described with its definition, syntax and description of the program.
🌐
Scribd
scribd.com › document › 410639630 › Cmath-Header-File
C++ Math.h Functions with Examples | PDF
• SYNTAX: • The C library function double modf(double x, double *integer) returns the fraction component (part after the decimal), and sets integer to the integer component. • double modf(double x, double *integer) • x − This is the ...
Rating: 5 ​ - ​ 1 votes