diff options
| author | bors <bors@rust-lang.org> | 2014-04-22 22:01:32 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-22 22:01:32 -0700 |
| commit | 30fe55066a29a14fffd2a5f41e0ab21e7056fb34 (patch) | |
| tree | d3f1b728cbb4e6a74970de28ad65931ee228e407 /src/doc/guide-tasks.md | |
| parent | 696f16ec2e54e8563702b1cdbbaaa1877562aa60 (diff) | |
| parent | 2d9dfc64792d14ba46b345b7e7f2913c6a9b28ca (diff) | |
| download | rust-30fe55066a29a14fffd2a5f41e0ab21e7056fb34.tar.gz rust-30fe55066a29a14fffd2a5f41e0ab21e7056fb34.zip | |
auto merge of #13597 : bjz/rust/float-api, r=brson
This pull request: - Merges the `Round` trait into the `Float` trait, continuing issue #10387. - Has floating point functions take their parameters by value. - Cleans up the formatting and organisation in the definition and implementations of the `Float` trait. More information on the breaking changes can be found in the commit messages.
Diffstat (limited to 'src/doc/guide-tasks.md')
| -rw-r--r-- | src/doc/guide-tasks.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/guide-tasks.md b/src/doc/guide-tasks.md index 26e5c053372..e6eb4f235e5 100644 --- a/src/doc/guide-tasks.md +++ b/src/doc/guide-tasks.md @@ -306,7 +306,7 @@ be distributed on the available cores. fn partial_sum(start: uint) -> f64 { let mut local_sum = 0f64; for num in range(start*100000, (start+1)*100000) { - local_sum += (num as f64 + 1.0).powf(&-2.0); + local_sum += (num as f64 + 1.0).powf(-2.0); } local_sum } @@ -343,7 +343,7 @@ extern crate sync; use sync::Arc; fn pnorm(nums: &[f64], p: uint) -> f64 { - nums.iter().fold(0.0, |a,b| a+(*b).powf(&(p as f64)) ).powf(&(1.0 / (p as f64))) + nums.iter().fold(0.0, |a, b| a + b.powf(p as f64)).powf(1.0 / (p as f64)) } fn main() { |
