home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / LIBC / LIBC-4.6 / LIBC-4 / libc-linux / sysdeps / linux / i386 / math / asinl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-26  |  1.1 KB  |  44 lines

  1. /* Copyright (C) 1993  Hongjiu Lu
  2.    Changed by Olaf Flebbe for long double
  3. This file is part of the Linux C Library.
  4.  
  5. The Linux C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9.  
  10. The Linux C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. Library General Public License for more details.  */
  14.  
  15. #include <ansidecl.h>
  16. #include <fp.h>
  17. #include <errno.h>
  18. #include "mathl.h"
  19.  
  20. long double
  21. DEFUN(asinl, (x), long double x)
  22. {
  23.   long double y;
  24.  
  25.   if (x <= -1.0L ) {
  26.     if (x == -1.0L) {
  27.       return -1.57079632679489661923L;
  28.     }
  29.     return __infnanl( EDOM);
  30.   } 
  31.  
  32.   if (x >= 1.0L ) {
  33.     if (x == 1.0L) {
  34.       return 1.57079632679489661923L;
  35.     }
  36.     return __infnanl( EDOM);
  37.   } 
  38.  
  39.   y = sqrtl (1.0L - x * x);
  40.   __asm__ __volatile__ ("fpatan"
  41.             :"=t" (y) : "0" (y), "u" (x));
  42.   return y;
  43. }
  44.