reactos/lib/sdk/crt/math/tanh.c
Art Yerkes c501d8112c Create a branch for network fixes.
svn path=/branches/aicom-network-fixes/; revision=34994
2008-08-01 11:32:26 +00:00

21 lines
325 B
C

/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <math.h>
/*
* @implemented
*/
double tanh(double x)
{
if (x > 50)
return 1;
else if (x < -50)
return -1;
else
{
const double ebig = exp(x);
const double esmall = 1.0/ebig;
return (ebig - esmall) / (ebig + esmall);
}
}