How to compute hyperbolic cosine in C

3 Answers

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

int main(void)
{
    double d = cosh(1);

    printf("%lf", d);
}





/*
run:

1.543081

*/

 



answered Jan 28, 2023 by avibootz
0 votes
#include <stdio.h>
#include <math.h>

int main(void)
{
    float f = coshf(-1);

    printf("%f", f);
}





/*
run:

1.543081

*/

 



answered Jan 28, 2023 by avibootz
0 votes
#include <stdio.h>
#include <math.h>

int main(void)
{
    long double ld = coshl(0.0);

    printf("%Lf", ld);
}





/*
run:

1.000000

*/

 



answered Jan 28, 2023 by avibootz

Related questions

3 answers 163 views
163 views asked Jan 25, 2023 by avibootz
1 answer 193 views
3 answers 113 views
113 views asked Jan 27, 2023 by avibootz
3 answers 134 views
134 views asked Jan 25, 2023 by avibootz
3 answers 142 views
3 answers 141 views
141 views asked Jan 25, 2023 by avibootz
...