Replace old pow_with_uint with the new pow func
There was an old and barely used implementation of pow, which expected both parameters to be uint and required more traits to be implemented. Since a new implementation for `pow` landed, I'm proposing to remove this old impl in favor of the new one. The benchmark shows that the new implementation is faster than the one being removed: test num::bench::bench_pow_function ..bench: 9429 ns/iter (+/- 2055) test num::bench::bench_pow_with_uint_function ...bench: 28476 ns/iter (+/- 2202)
This commit is contained in:
parent
aaf8ba7c51
commit
3830a3b4f2
3 changed files with 8 additions and 44 deletions
|
@ -688,7 +688,7 @@ impl<T : Iterator<char>> Parser<T> {
|
|||
}
|
||||
}
|
||||
|
||||
let exp: f64 = num::pow_with_uint(10u, exp);
|
||||
let exp: f64 = num::pow(10u as f64, exp);
|
||||
if neg_exp {
|
||||
res /= exp;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue