C sinh() Function

Beginner
5 min read
Updated: Nov 2026
3 examples
math.h

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.

C
sinh(0.0);
CallWhat it does
sinh(0.0)Returns 0.

Include <math.h>. On GCC, link with -lm. x is not an angle in degrees.

Library declarations
C
double sinh(double x);
float sinhf(float x);
long double sinhl(long double x);

Parameters

ParameterDescription
xRequired. Any real double. It is not an angle.

Return Value

Return ValueDescription
Hyperbolic sineA 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.

C
#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;
}

How It Works

  1. Include math.h. Declares sinh; link with -lm on GCC.
  2. Zero. sinh(0) is exactly 0.
  3. Positive. sinh(1) ≈ 1.17520.
  4. 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.

C
#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;
}

How It Works

  1. Library call. sinh(1.5) uses a carefully coded implementation.
  2. Hand formula. Build the same value from two exp calls.
  3. They agree. Digits match for this moderate input.
  4. 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.

C
#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;
}

How It Works

  1. Same x = 1. For sin, that means 1 radian; for sinh, a hyperbolic argument.
  2. Different results. ≈ 1.175 vs ≈ 0.841.
  3. Different ranges. sin stays in [-1, 1]; sinh does not.
  4. 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.

Next: sqrt()

Compute the square root of a non-negative double.

sqrt() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

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