stdlib: An implementation of SDL_scalbn using ldexp() (thanks, Ozkan!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 29 Aug 2017 00:36:17 -0400
changeset 11404bd5b569b2a1b
parent 11403 4cdc242e4102
child 11405 4e12f78c2b0e
stdlib: An implementation of SDL_scalbn using ldexp() (thanks, Ozkan!).

Fixes Bugzilla #3767.
src/stdlib/SDL_stdlib.c
     1.1 --- a/src/stdlib/SDL_stdlib.c	Tue Aug 29 00:02:04 2017 -0400
     1.2 +++ b/src/stdlib/SDL_stdlib.c	Tue Aug 29 00:36:17 2017 -0400
     1.3 @@ -187,6 +187,10 @@
     1.4      return scalbn(x, n);
     1.5  #elif defined(HAVE__SCALB)
     1.6      return _scalb(x, n);
     1.7 +#elif defined(HAVE_LIBC) && defined(HAVE_FLOAT_H) && (FLT_RADIX == 2)
     1.8 +/* from scalbn(3): If FLT_RADIX equals 2 (which is
     1.9 + * usual), then scalbn() is equivalent to ldexp(3). */
    1.10 +    return ldexp(x, n);
    1.11  #else
    1.12      return SDL_uclibc_scalbn(x, n);
    1.13  #endif /* HAVE_SCALBN */