C sinh() Function

Definition
In C, sinh() returns the hyperbolic sine of x. It is not an angle. sinh(0) is 0, and a negative input gives a negative result.
You pass one double. The result is a double with the same sign as x. Include <math.h>.
Syntax
Pass any real number. Start with this call.
| Call | What it does |
|---|
sinh(0.0) | Returns 0. |
Include <math.h>. On GCC, link with -lm. x is not an angle in degrees.
Library declarations
double sinh(double x);
float sinhf(float x);
long double sinhl(long double x);
Parameters
| Parameter | Description |
|---|
| x | Required. Any real double. It is not an angle. |
Return Value
| Return Value | Description |
|---|
| Hyperbolic sine | A double with the same sign as x. Zero stays zero. |
C Examples
Example 1 — Positive, Zero, and Negative
sinh is odd: negatives flip the sign of the result.
#include <math.h>
#include <stdio.h>
int main(void) {
printf("sinh(0) = %.5f\n", sinh(0.0));
printf("sinh(1) = %.5f\n", sinh(1.0));
printf("sinh(-1) = %.5f\n", sinh(-1.0));
return 0;
}
sinh(0) = 0.00000
sinh(1) = 1.17520
sinh(-1) = -1.17520
How It Works
- Include math.h. Declares
sinh; link with -lm on GCC. - Zero.
sinh(0) is exactly 0. - Positive.
sinh(1) ≈ 1.17520. - Odd symmetry.
sinh(-1) is the negation of sinh(1).
Example 2 — Match the exp Formula
Compare the library call with (exp(x) - exp(-x)) / 2 using exp.
#include <math.h>
#include <stdio.h>
int main(void) {
double x = 1.5;
double lib = sinh(x);
double hand = (exp(x) - exp(-x)) / 2.0;
printf("sinh(%.1f) = %.8f\n", x, lib);
printf("exp form = %.8f\n", hand);
return 0;
}
sinh(1.5) = 2.12927946
exp form = 2.12927946
How It Works
- Library call.
sinh(1.5) uses a carefully coded implementation. - Hand formula. Build the same value from two
exp calls. - They agree. Digits match for this moderate input.
- Prefer sinh. Clearer, and usually more accurate for large
|x|.
Example 3 — sinh vs sin
Same numeric argument, different functions—do not mix them up.
#include <math.h>
#include <stdio.h>
int main(void) {
double x = 1.0;
printf("sinh(%.1f) = %.5f\n", x, sinh(x));
printf("sin(%.1f) = %.5f\n", x, sin(x));
return 0;
}
sinh(1.0) = 1.17520
sin(1.0) = 0.84147
How It Works
- Same x = 1. For
sin, that means 1 radian; for sinh, a hyperbolic argument. - Different results. ≈
1.175 vs ≈ 0.841. - Different ranges.
sin stays in [-1, 1]; sinh does not. - Pick by problem. Waves/angles →
sin; hyperbolic identities → sinh.
Frequently Asked Questions
sinh() returns the hyperbolic sine of x. sinh(0) is 0, and a negative x gives a negative result.
x is required. Any real double is allowed. It is not an angle.
A double with the same sign as x.
Include <math.h>. On GCC, link with -lm.
No. sin() takes an angle in radians. sinh() is the hyperbolic sine.
About the author
Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
9 people found this page helpful