home *** CD-ROM | disk | FTP | other *** search
/ Total Destruction / Total_Destruction.iso / addons / Lccwin32.exe / Lccwin32 / lccpub / lib / src / asinh.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-14  |  642 b   |  34 lines

  1. #include <math.h>
  2. #include <stdio.h>
  3. #include <errno.h>
  4. double asinh(double farg)
  5. {
  6.     return log( farg + sqrt(farg * farg + 1.0) );
  7. }
  8.  
  9. #ifdef STANDALONE
  10. /*
  11. Correct output:
  12. [0.1] 0.099834078899208
  13. [0.2] 0.198690110349241
  14. [0.3] 0.295673047563423
  15. [0.4] 0.390035319770715
  16. [0.5] 0.481211825059603
  17. [0.6] 0.568824898732248
  18. [0.7] 0.652666566082356
  19. [0.8] 0.732668256045411
  20. [0.9] 0.808866935652783
  21. */
  22. int main()
  23. {
  24.         int i=1;
  25.         double r;
  26.  
  27.         while (i < 10) {
  28.                 r= asinh((double)i/10.0);
  29.                 printf("[%3.1f] %10.15f\n",(double)i/10.0,r);
  30.                 i++;
  31.         }
  32. #endif
  33.