mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-11-14 10:39:05 +00:00
fix math::is_odd for a negative argument
I think that sprout::math::is_odd(-1) should be true. It also fixes math::pow for a case that x is a negative and y is a negative odd integer. cf. http://melpon.org/wandbox/permlink/XVKea2I6CdVJCbZX
This commit is contained in:
parent
5c10e4d85c
commit
191867afe0
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
is_odd(FloatType x) {
|
||||
return sprout::math::isfinite(x)
|
||||
&& sprout::math::detail::is_odd_unchecked(x)
|
||||
&& sprout::math::detail::is_odd_unchecked(x < 0 ? -x : x)
|
||||
;
|
||||
}
|
||||
} // namespace math
|
||||
|
|
Loading…
Reference in a new issue