forked from Green-Sky/tomato
Merge commit '852f2a6343518919e5ca8d3c1bbcab9f493e3cd8'
This commit is contained in:
9
external/sdl/SDL/src/libm/e_exp.c
vendored
9
external/sdl/SDL/src/libm/e_exp.c
vendored
@ -98,6 +98,13 @@ P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
|
||||
P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
|
||||
P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
|
||||
|
||||
union {
|
||||
Uint64 u64;
|
||||
double d;
|
||||
} inf_union = {
|
||||
0x7ff0000000000000 /* Binary representation of a 64-bit infinite double (sign=0, exponent=2047, mantissa=0) */
|
||||
};
|
||||
|
||||
double __ieee754_exp(double x) /* default IEEE double exp */
|
||||
{
|
||||
double y;
|
||||
@ -123,6 +130,8 @@ double __ieee754_exp(double x) /* default IEEE double exp */
|
||||
else return (xsb==0)? x:0.0; /* exp(+-inf)={inf,0} */
|
||||
}
|
||||
#if 1
|
||||
if(x > o_threshold) return inf_union.d; /* overflow */
|
||||
#elif 1
|
||||
if(x > o_threshold) return huge*huge; /* overflow */
|
||||
#else /* !!! FIXME: check this: "huge * huge" is a compiler warning, maybe they wanted +Inf? */
|
||||
if(x > o_threshold) return INFINITY; /* overflow */
|
||||
|
2
external/sdl/SDL/src/libm/math_libm.h
vendored
2
external/sdl/SDL/src/libm/math_libm.h
vendored
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
Reference in New Issue
Block a user