1 package File
::Rsync
::Mirror
::Recentfile
::FakeBigFloat
;
10 sub _bigfloatmax
($$);
11 sub _bigfloatmin
($$);
17 File::Rsync::Mirror::Recentfile::FakeBigFloat - very limited bigfloat support
25 use version
; our $VERSION = qv
('0.0.1');
28 use base
qw(Exporter);
30 our @EXPORT_OK = qw( _bigfloatcmp _bigfloatmin _bigfloatmax _bigfloatlt _bigfloatgt );
31 $EXPORT_TAGS{all
} = \
@EXPORT_OK;
35 use File::Rsync::Mirror::Recentfile::FakeBigFloat qw(:all);
39 All functions are exported in the C<:all> tag.
41 =head1 (ONLY) INTERNAL FUNCTIONS
43 These functions are not part of a public interface and can be
44 changed and go away any time without prior notice.
46 =head2 _bigfloatcmp ( $l, $r )
48 Cmp function for floating point numbers that have a longer
49 mantissa than can be handled by native perl floats.
52 sub _bigfloatcmp
($$) {
54 my $native = $l <=> $r;
55 return $native if $native;
57 $_ .= ".0" unless /\./;
59 $l =~ s/^/0/ while index($l,".") < index($r,".");
60 $r =~ s/^/0/ while index($r,".") < index($l,".");
64 =head2 _bigfloatgt ( $l, $r )
69 sub _bigfloatgt
($$) {
71 _bigfloatcmp
($l,$r) > 0;
74 =head2 _bigfloatlt ( $l, $r )
79 sub _bigfloatlt
($$) {
81 _bigfloatcmp
($l,$r) < 0;
84 =head2 _bigfloatmax ( $l, $r )
86 Same for max (of two arguments)
89 sub _bigfloatmax
($$) {
91 return _bigfloatcmp
($l,$r) >= 0 ?
$l : $r;
94 =head2 _bigfloatmin ( $l, $r )
96 Same for min (of two arguments)
99 sub _bigfloatmin
($$) {
101 return _bigfloatcmp
($l,$r) <= 0 ?
$l : $r;
104 =head1 COPYRIGHT & LICENSE
106 Copyright 2008 Andreas König.
108 This program is free software; you can redistribute it and/or modify it
109 under the same terms as Perl itself.
113 1; # End of File::Rsync::Mirror::Recentfile
117 # cperl-indent-level: 4