Codebase list libmath-round-perl / 696fe9b
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
4 changed file(s) with 33 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
2222 - Streamlined the code. Thanks to Richard Jelinek of PetaMem.
2323 - Made $half a package variable. Thanks to Ruud H. G. van Tol
2424 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
2323
2424 Recent Changes
2525 ==============
26 Version 0.04: Added nearest_ceil and nearest_floor.
2726 Version 0.05: Added nlowmult and nhimult.
2827 Version 0.06: Streamlined the code.
28 Version 0.07: Corrected possible conflict with POSIX.
2929
3030 How to Install
3131 ==============
4141 it under the same terms as Perl itself.
4242
4343 Geoffrey Rommel
44 DBA Tech Consultant
45 Sears, Roebuck and Co.
4644 GROMMEL@cpan.org
4745
4846 October 2000
00 package Math::Round;
11
22 use strict;
3 use POSIX;
3 use POSIX ();
44 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
55
66 require Exporter;
1010 @EXPORT_OK = qw(round nearest round_even round_odd round_rand
1111 nearest_ceil nearest_floor nearest_rand
1212 nlowmult nhimult );
13 $VERSION = '0.06';
13 $VERSION = '0.07';
1414
1515 %EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
1616
185185 "to infinity"; i.e., positive values are rounded up (e.g., 2.5
186186 becomes 3) and negative values down (e.g., -2.5 becomes -3).
187187
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
188192 =item B<round_even> LIST
189193
190194 Rounds the number(s) to the nearest integer. In scalar context,
312316 these routines use a value for
313317 one-half that is slightly larger than 0.5. Nevertheless,
314318 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
316320 compiler, etc.
317321
318322 =head1 AUTHOR