(root)/
glibc-2.38/
sysdeps/
ieee754/
ldbl-128ibm/
s_finitel.c
       1  /* s_finitel.c -- long double version of s_finite.c.
       2   */
       3  
       4  /*
       5   * ====================================================
       6   * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
       7   *
       8   * Developed at SunPro, a Sun Microsystems, Inc. business.
       9   * Permission to use, copy, modify, and distribute this
      10   * software is freely granted, provided that this notice
      11   * is preserved.
      12   * ====================================================
      13   */
      14  
      15  #if defined(LIBM_SCCS) && !defined(lint)
      16  static char rcsid[] = "$NetBSD: $";
      17  #endif
      18  
      19  /*
      20   * finitel(x) returns 1 is x is finite, else 0;
      21   * no branching!
      22   */
      23  
      24  #include <math.h>
      25  #include <math_private.h>
      26  #include <math_ldbl_opt.h>
      27  
      28  int
      29  ___finitel (long double x)
      30  {
      31    uint64_t hx;
      32    double xhi;
      33  
      34    xhi = ldbl_high (x);
      35    EXTRACT_WORDS64 (hx, xhi);
      36    hx &= 0x7ff0000000000000LL;
      37    hx -= 0x7ff0000000000000LL;
      38    return hx >> 63;
      39  }
      40  hidden_ver (___finitel, __finitel)
      41  weak_alias (___finitel, ____finitel)
      42  #if IS_IN (libm)
      43  long_double_symbol (libm, ____finitel, finitel);
      44  long_double_symbol (libm, ___finitel, __finitel);
      45  #else
      46  long_double_symbol (libc, ____finitel, finitel);
      47  long_double_symbol (libc, ___finitel, __finitel);
      48  #endif