s_fabsf.c 853 B

12345678910111213141516171819202122232425262728293031323334
  1. /* s_fabsf.c -- float version of s_fabs.c.
  2. * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
  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. #include "cdefs-compat.h"
  15. //__FBSDID("$FreeBSD: src/lib/msun/src/s_fabsf.c,v 1.8 2008/02/22 02:30:35 das Exp $");
  16. /*
  17. * fabsf(x) returns the absolute value of x.
  18. */
  19. #include <openlibm_math.h>
  20. #include "math_private.h"
  21. DLLEXPORT float
  22. fabsf(float x)
  23. {
  24. u_int32_t ix;
  25. GET_FLOAT_WORD(ix,x);
  26. SET_FLOAT_WORD(x,ix&0x7fffffff);
  27. return x;
  28. }