diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/src/libm/s_isinf.c | |
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/src/libm/s_isinf.c')
| -rw-r--r-- | contrib/SDL-3.2.8/src/libm/s_isinf.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/libm/s_isinf.c b/contrib/SDL-3.2.8/src/libm/s_isinf.c new file mode 100644 index 0000000..9486b05 --- /dev/null +++ b/contrib/SDL-3.2.8/src/libm/s_isinf.c | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #include "SDL_internal.h" | ||
| 2 | /* | ||
| 3 | * Written by J.T. Conklin <jtc@netbsd.org>. | ||
| 4 | * Changed to return -1 for -Inf by Ulrich Drepper <drepper@cygnus.com>. | ||
| 5 | * Public domain. | ||
| 6 | */ | ||
| 7 | |||
| 8 | /* | ||
| 9 | * isinf(x) returns 1 is x is inf, -1 if x is -inf, else 0; | ||
| 10 | * no branching! | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include "math.h" | ||
| 14 | #include "math_private.h" | ||
| 15 | |||
| 16 | int __isinf(double x) | ||
| 17 | { | ||
| 18 | int32_t hx,lx; | ||
| 19 | EXTRACT_WORDS(hx,lx,x); | ||
| 20 | lx |= (hx & 0x7fffffff) ^ 0x7ff00000; | ||
| 21 | lx |= -lx; | ||
| 22 | return ~(lx >> 31) & (hx >> 30); | ||
| 23 | } | ||
| 24 | libm_hidden_def(__isinf) | ||
