Print this page




  28  */
  29 
  30 #if defined(ELFOBJ)
  31 #pragma weak isnanl = __isnanl
  32 #endif
  33 
  34 #include "libm.h"
  35 
  36 #if defined(__sparc)
  37 int
  38 isnanl(long double x) {
  39         int *px = (int *) &x;
  40         return ((px[0] & ~0x80000000) >= 0x7fff0000 &&
  41                 ((px[0] & ~0xffff0000) | px[1] | px[2] | px[3]) != 0);
  42 }
  43 #elif defined(__x86)
  44 int
  45 isnanl(long double x) {
  46         int *px = (int *) &x, t = px[2] & 0x7fff;
  47 #if defined(HANDLE_UNSUPPORTED)
  48         return (t == 0x7fff && ((px[1] & ~0x80000000) | px[0]) != 0 ||
  49                 t != 0 && (px[1] & 0x80000000) == 0);
  50 #else
  51         return (t == 0x7fff && ((px[1] & ~0x80000000) | px[0]) != 0);
  52 #endif
  53 }
  54 #endif  /* defined(__sparc) || defined(__x86) */


  28  */
  29 
  30 #if defined(ELFOBJ)
  31 #pragma weak isnanl = __isnanl
  32 #endif
  33 
  34 #include "libm.h"
  35 
  36 #if defined(__sparc)
  37 int
  38 isnanl(long double x) {
  39         int *px = (int *) &x;
  40         return ((px[0] & ~0x80000000) >= 0x7fff0000 &&
  41                 ((px[0] & ~0xffff0000) | px[1] | px[2] | px[3]) != 0);
  42 }
  43 #elif defined(__x86)
  44 int
  45 isnanl(long double x) {
  46         int *px = (int *) &x, t = px[2] & 0x7fff;
  47 #if defined(HANDLE_UNSUPPORTED)
  48         return ((t == 0x7fff && ((px[1] & ~0x80000000) | px[0]) != 0) ||
  49                 (t != 0 && (px[1] & 0x80000000) == 0));
  50 #else
  51         return (t == 0x7fff && ((px[1] & ~0x80000000) | px[0]) != 0);
  52 #endif
  53 }
  54 #endif  /* defined(__sparc) || defined(__x86) */