Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[other/n-body.pl] use given instead of explicit $_
  • Loading branch information
gerdr committed May 8, 2012
1 parent d147721 commit 1ce1e53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions other/n-body.pl
Expand Up @@ -103,8 +103,8 @@ (Num $dt)
.r.addmul(.v, $dt) for @bodies;
}

$_ = @bodies[Sun];
.v.addmul(total-momentum, -1e0 / .m);
.v.addmul(total-momentum, -1e0 / .m)
given @bodies[Sun];

sub MAIN(Int $n, Num $dt = 1e-2) {
printf "%.9f\n", total-energy;
Expand Down

0 comments on commit 1ce1e53

Please sign in to comment.