Skip to content

Commit

Permalink
powl, ceill, floorl, fmodl -> std:: equivalents from <cmath>
Browse files Browse the repository at this point in the history
value::to_integral_number works with std::pow etc, fixes
build on FreeBSD, which doesn't have these in the system C headers,
but the system C++ compiler (GCC) has them.

* libflusspferd/spidermonkey/value.cpp
  • Loading branch information
roman-neuhauser authored and ruediger committed May 8, 2010
1 parent 69f2327 commit e29e84c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libflusspferd/spidermonkey/value.cpp
Expand Up @@ -103,9 +103,9 @@ double value::to_integral_number(int bits, bool signedness) const {
if (!std::isfinite(value))
return 0;
#endif
long double maxU = powl(2, bits);
value = value < 0 ? ceill(value) : floorl(value);
value = fmodl(value, maxU);
long double maxU = std::pow(2.0L, bits);
value = value < 0 ? std::ceil(value) : std::floor(value);
value = std::fmod(value, maxU);
if (value < 0)
value += maxU;
if (signedness) {
Expand Down

0 comments on commit e29e84c

Please sign in to comment.