1
Math::Round -- Perl extension for rounding numbers
3
Math::Round is a Perl module. It supplies functions to round numbers,
4
both positive and negative, in various ways. This may seem like an
5
odd thing to write a whole module for, but rounding can sometimes be
6
a little tricky, so I thought some people might find this useful.
8
round: round to the nearest integer; numbers ending in .5 go
9
"to infinity" (3.5 becomes 4, -3.5 becomes -4)
10
round_even: round; numbers ending in .5 go to the even number
11
round_odd: round; numbers ending in .5 go to the odd number
12
round_rand: round; numbers ending in .5 go up or down randomly
14
nearest: round to the nearest multiple of any number
15
nearest_ceil: like nearest; numbers halfway between two multiples
17
nearest_floor: like nearest; numbers halfway between two multiples
19
nearest_rand: like nearest; numbers halfway between two multiples
20
go up or down randomly
22
nlowmult: next lower multiple of a number
23
nhimult: next higher multiple of a number
27
Version 0.04: Added nearest_ceil and nearest_floor.
28
Version 0.05: Added nlowmult and nhimult.
39
Copyright � 2002 Geoffrey Rommel. All rights reserved.
40
This program is free software; you can redistribute it and/or modify
41
it under the same terms as Perl itself.
45
Sears, Roebuck and Co.