Skip to content

Commit

Permalink
stdlib: An implementation of SDL_scalbn using ldexp() (thanks, Ozkan!).
Browse files Browse the repository at this point in the history
Fixes Bugzilla #3767.
  • Loading branch information
icculus committed Aug 29, 2017
1 parent a0cd7d6 commit 620f534
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/stdlib/SDL_stdlib.c
Expand Up @@ -187,6 +187,10 @@ SDL_scalbn(double x, int n)
return scalbn(x, n);
#elif defined(HAVE__SCALB)
return _scalb(x, n);
#elif defined(HAVE_LIBC) && defined(HAVE_FLOAT_H) && (FLT_RADIX == 2)
/* from scalbn(3): If FLT_RADIX equals 2 (which is
* usual), then scalbn() is equivalent to ldexp(3). */
return ldexp(x, n);
#else
return SDL_uclibc_scalbn(x, n);
#endif /* HAVE_SCALBN */
Expand Down

0 comments on commit 620f534

Please sign in to comment.