diff options
Diffstat (limited to 'contrib/SDL-3.2.8/src/libm/s_isinff.c')
| -rw-r--r-- | contrib/SDL-3.2.8/src/libm/s_isinff.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/libm/s_isinff.c b/contrib/SDL-3.2.8/src/libm/s_isinff.c new file mode 100644 index 0000000..184c9aa --- /dev/null +++ b/contrib/SDL-3.2.8/src/libm/s_isinff.c | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #include "SDL_internal.h" | ||
| 2 | /* | ||
| 3 | * Written by J.T. Conklin <jtc@netbsd.org>. | ||
| 4 | * Public domain. | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* | ||
| 8 | * isinff(x) returns 1 if x is inf, -1 if x is -inf, else 0; | ||
| 9 | * no branching! | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include "math.h" | ||
| 13 | #include "math_private.h" | ||
| 14 | |||
| 15 | int __isinff (float x) | ||
| 16 | { | ||
| 17 | int32_t ix,t; | ||
| 18 | GET_FLOAT_WORD(ix,x); | ||
| 19 | t = ix & 0x7fffffff; | ||
| 20 | t ^= 0x7f800000; | ||
| 21 | t |= -t; | ||
| 22 | return ~(t >> 31) & (ix >> 30); | ||
| 23 | } | ||
| 24 | libm_hidden_def(__isinff) | ||
