fabsq.c 814 B

1234567891011121314151617181920212223242526272829303132
  1. /* s_fabsl.c -- long double version of s_fabs.c.
  2. * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
  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. #if defined(LIBM_SCCS) && !defined(lint)
  15. static char rcsid[] = "$NetBSD: $";
  16. #endif
  17. /*
  18. * fabsq(x) returns the absolute value of x.
  19. */
  20. #include "quadmath-imp.h"
  21. __float128 fabsq(__float128 x)
  22. {
  23. uint64_t hx;
  24. GET_FLT128_MSW64(hx,x);
  25. SET_FLT128_MSW64(x,hx&0x7fffffffffffffffLL);
  26. return x;
  27. }