Using std::exp and then a multiplication looses a lot of precision which can cause hard to find bugs (who would expect exp2 to fail?) because all powers of two with integer exponents can be expressed precisely with ieee754 floating point. This also should be good for performance, since exp2 with integer exponent is just shifting some bits in ieee754 and good implementers will probably leverage that to implement exp2 efficiently.master
parent
708a886bb0
commit
c79dfbc925
1 changed files with 4 additions and 0 deletions
Loading…
Reference in New Issue