Blame sysdeps/ieee754/flt-32/s_isnanf.c
|
Packit |
6c4009 |
/* s_isnanf.c -- float version of s_isnan.c.
|
|
Packit |
6c4009 |
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* ====================================================
|
|
Packit |
6c4009 |
* Copyright (C) 1993, 2011 by Sun Microsystems, Inc. All rights reserved.
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
Packit |
6c4009 |
* Permission to use, copy, modify, and distribute this
|
|
Packit |
6c4009 |
* software is freely granted, provided that this notice
|
|
Packit |
6c4009 |
* is preserved.
|
|
Packit |
6c4009 |
* ====================================================
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#if defined(LIBM_SCCS) && !defined(lint)
|
|
Packit |
6c4009 |
static char rcsid[] = "$NetBSD: s_isnanf.c,v 1.4 1995/05/10 20:47:38 jtc Exp $";
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* isnanf(x) returns 1 is x is nan, else 0;
|
|
Packit |
6c4009 |
* no branching!
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <math.h>
|
|
Packit |
6c4009 |
#include <math_private.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#undef __isnanf
|
|
Packit |
6c4009 |
int __isnanf(float x)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
int32_t ix;
|
|
Packit |
6c4009 |
GET_FLOAT_WORD(ix,x);
|
|
Packit |
6c4009 |
ix &= 0x7fffffff;
|
|
Packit |
6c4009 |
ix = 0x7f800000 - ix;
|
|
Packit |
6c4009 |
return (int)(((uint32_t)(ix))>>31);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
hidden_def (__isnanf)
|
|
Packit |
6c4009 |
weak_alias (__isnanf, isnanf)
|