Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
round method produces a Real, not always Int
provided a better description of what the specced algorithm actually does
  • Loading branch information
labster committed Jun 23, 2013
1 parent 9b6b82a commit 0cca600
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions S32-setting-library/Numeric.pod
Expand Up @@ -265,9 +265,10 @@ Returns the lowest integer not less than C<$x>.

=item round

multi method round ( Real $x: $scale = 1 --> Int ) is export
multi method round ( Real $x: $scale = 1 --> Real ) is export

Returns the nearest integer to C<$x>. The algorithm is:
With no arguments, returns the nearest integer to C<$x>. If C<$scale>
is given, rounds $x to the nearest multiple of C<$scale>. The algorithm is:

floor($x / $scale + 0.5) * $scale

Expand Down

0 comments on commit 0cca600

Please sign in to comment.