home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / math / sinh.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-29  |  290 b   |  17 lines

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <math.h>
  3.  
  4. double sinh(double x)
  5. {
  6.  if(x >= 0.0)
  7.  {
  8.    const double epos = exp(x);
  9.    return (epos - 1.0/epos) / 2.0;
  10.  }
  11.  else
  12.  {
  13.    const double eneg = exp(-x);
  14.    return (1.0/eneg - eneg) / 2.0;
  15.  }
  16. }
  17.