diff options
| author | bors <bors@rust-lang.org> | 2014-01-19 19:46:35 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-19 19:46:35 -0800 |
| commit | 764f2cb6f3517869e31fc7b93ff11dd840db8d30 (patch) | |
| tree | ad183f07bbaad8493d23db4d2fcc7f5263fa4aab /src/libextra | |
| parent | 0e6455e2b8ee707c0683c67ba224b7682aff4e85 (diff) | |
| parent | 3830a3b4f2559165a89847320d277ef827dd1da9 (diff) | |
| download | rust-764f2cb6f3517869e31fc7b93ff11dd840db8d30.tar.gz rust-764f2cb6f3517869e31fc7b93ff11dd840db8d30.zip | |
auto merge of #11649 : FlaPer87/rust/pow, r=cmr
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)
```
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/json.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libextra/json.rs b/src/libextra/json.rs index 76dc1d31c49..cba4364d5b4 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -909,7 +909,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 { |
