| 1 | #include "SDL_internal.h" | 
|---|
| 2 | /* s_isnanf.c -- float version of s_isnan.c. | 
|---|
| 3 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. | 
|---|
| 4 | */ | 
|---|
| 5 |  | 
|---|
| 6 | /* | 
|---|
| 7 | * ==================================================== | 
|---|
| 8 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. | 
|---|
| 9 | * | 
|---|
| 10 | * Developed at SunPro, a Sun Microsystems, Inc. business. | 
|---|
| 11 | * Permission to use, copy, modify, and distribute this | 
|---|
| 12 | * software is freely granted, provided that this notice | 
|---|
| 13 | * is preserved. | 
|---|
| 14 | * ==================================================== | 
|---|
| 15 | */ | 
|---|
| 16 |  | 
|---|
| 17 | /* | 
|---|
| 18 | * isnanf(x) returns 1 is x is nan, else 0; | 
|---|
| 19 | * no branching! | 
|---|
| 20 | */ | 
|---|
| 21 |  | 
|---|
| 22 | #include "math.h" | 
|---|
| 23 | #include "math_private.h" | 
|---|
| 24 |  | 
|---|
| 25 | int __isnanf(float x) | 
|---|
| 26 | { | 
|---|
| 27 | int32_t ix; | 
|---|
| 28 | GET_FLOAT_WORD(ix,x); | 
|---|
| 29 | ix &= 0x7fffffff; | 
|---|
| 30 | ix = 0x7f800000 - ix; | 
|---|
| 31 | return (int)(((u_int32_t)(ix))>>31); | 
|---|
| 32 | } | 
|---|
| 33 | libm_hidden_def(__isnanf) | 
|---|
| 34 |  | 
|---|