Merge tag 'upstream/0.07'
Upstream version 0.07
# gpg: Signature made Mon 27 Apr 2015 11:57:31 PM CEST
# gpg: using RSA key 6BE663C75A35C975
# gpg: please do a --check-trustdb
# gpg: Good signature from "Axel Beckert <abe@deuxchevaux.org>"
# gpg: aka "Axel Beckert (E-Mail + Jabber) <abe@noone.org>"
# gpg: aka "Axel Beckert (Symlink) <xtaran@symlink.ch>"
# gpg: aka "[jpeg image of size 3155]"
# gpg: aka "Axel Stefan Beckert"
# gpg: aka "Axel Beckert (FSFE Fellow) <abe@fsfe.org>"
# gpg: aka "Axel Beckert (Debian Developer) <abe@debian.org>"
Axel Beckert
9 years ago
22 | 22 |
- Streamlined the code. Thanks to Richard Jelinek of PetaMem.
|
23 | 23 |
- Made $half a package variable. Thanks to Ruud H. G. van Tol
|
24 | 24 |
for pointing out some peculiarities of the rounding.
|
|
25 |
|
|
26 |
0.07 Fri Jan 2 10:35:47 2015
|
|
27 |
- Perl 5.22 exports POSIX::round, so "use POSIX" had to be
|
|
28 |
changed to "use POSIX ()". Thanks to Jarkko Hietaniemi and
|
|
29 |
Slaven Rezic for the tip.
|
0 | |
# http://module-build.sourceforge.net/META-spec.html
|
1 | |
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
|
2 | |
name: Math-Round
|
3 | |
version: 0.06
|
4 | |
version_from: Round.pm
|
5 | |
installdirs: site
|
6 | |
requires:
|
7 | |
|
8 | |
distribution_type: module
|
9 | |
generated_by: ExtUtils::MakeMaker version 6.17
|
|
0 |
--- #YAML:1.0
|
|
1 |
name: Math-Round
|
|
2 |
version: 0.07
|
|
3 |
abstract: ~
|
|
4 |
author: []
|
|
5 |
license: unknown
|
|
6 |
distribution_type: module
|
|
7 |
configure_requires:
|
|
8 |
ExtUtils::MakeMaker: 0
|
|
9 |
build_requires:
|
|
10 |
ExtUtils::MakeMaker: 0
|
|
11 |
requires: {}
|
|
12 |
no_index:
|
|
13 |
directory:
|
|
14 |
- t
|
|
15 |
- inc
|
|
16 |
generated_by: ExtUtils::MakeMaker version 6.55_02
|
|
17 |
meta-spec:
|
|
18 |
url: http://module-build.sourceforge.net/META-spec-v1.4.html
|
|
19 |
version: 1.4
|
23 | 23 |
|
24 | 24 |
Recent Changes
|
25 | 25 |
==============
|
26 | |
Version 0.04: Added nearest_ceil and nearest_floor.
|
27 | 26 |
Version 0.05: Added nlowmult and nhimult.
|
28 | 27 |
Version 0.06: Streamlined the code.
|
|
28 |
Version 0.07: Corrected possible conflict with POSIX.
|
29 | 29 |
|
30 | 30 |
How to Install
|
31 | 31 |
==============
|
|
41 | 41 |
it under the same terms as Perl itself.
|
42 | 42 |
|
43 | 43 |
Geoffrey Rommel
|
44 | |
DBA Tech Consultant
|
45 | |
Sears, Roebuck and Co.
|
46 | 44 |
GROMMEL@cpan.org
|
47 | 45 |
|
48 | 46 |
October 2000
|
0 | 0 |
package Math::Round;
|
1 | 1 |
|
2 | 2 |
use strict;
|
3 | |
use POSIX;
|
|
3 |
use POSIX ();
|
4 | 4 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
|
5 | 5 |
|
6 | 6 |
require Exporter;
|
|
10 | 10 |
@EXPORT_OK = qw(round nearest round_even round_odd round_rand
|
11 | 11 |
nearest_ceil nearest_floor nearest_rand
|
12 | 12 |
nlowmult nhimult );
|
13 | |
$VERSION = '0.06';
|
|
13 |
$VERSION = '0.07';
|
14 | 14 |
|
15 | 15 |
%EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
|
16 | 16 |
|
|
185 | 185 |
"to infinity"; i.e., positive values are rounded up (e.g., 2.5
|
186 | 186 |
becomes 3) and negative values down (e.g., -2.5 becomes -3).
|
187 | 187 |
|
|
188 |
Starting in Perl 5.22, the POSIX module by default exports all functions,
|
|
189 |
including one named "round". If you use both POSIX and this module,
|
|
190 |
exercise due caution.
|
|
191 |
|
188 | 192 |
=item B<round_even> LIST
|
189 | 193 |
|
190 | 194 |
Rounds the number(s) to the nearest integer. In scalar context,
|
|
312 | 316 |
these routines use a value for
|
313 | 317 |
one-half that is slightly larger than 0.5. Nevertheless,
|
314 | 318 |
if the numbers to be rounded are stored as floating-point, they will
|
315 | |
be subject, as usual, to the mercies of your hardware, your C
|
|
319 |
be subject as usual to the mercies of your hardware, your C
|
316 | 320 |
compiler, etc.
|
317 | 321 |
|
318 | 322 |
=head1 AUTHOR
|