| 1 | package Zuzu::Util::Number; | ||||||||||
| 2 | |||||||||||
| 3 | 9 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 9 | our $VERSION = '0.007002'; | |||||||||
| 6 | |||||||||||
| 7 | 9 | ▶ | use Exporter qw( import ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 9 | our @EXPORT_OK = qw( | |||||||||
| 10 | is_finite_number | ||||||||||
| 11 | ); | ||||||||||
| 12 | |||||||||||
| 13 | 9 | my $POSITIVE_INFINITY = 9**9**9; | |||||||||
| 14 | 9 | my $NEGATIVE_INFINITY = -$POSITIVE_INFINITY; | |||||||||
| 15 | |||||||||||
| 16 | 152 | ▶ | sub is_finite_number { | ||||||||
|
Subroutine
is_finite_number: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 17 | 152 | my ( $number ) = @_; | |||||||||
| 18 | |||||||||||
| 19 | 152 | $number = 0 + $number; | |||||||||
| 20 | 152 | ▶ | return 0 if $number != $number; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 151 | ▶ | return 0 if $number == $POSITIVE_INFINITY; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 149 | ▶ | return 0 if $number == $NEGATIVE_INFINITY; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 148 | return 1; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 9 | 1; | |||||||||
| 27 | |||||||||||
| 28 | =pod | ||||||||||
| 29 | |||||||||||
| 30 | =head1 COPYRIGHT AND LICENCE | ||||||||||
| 31 | |||||||||||
| 32 | B<< Zuzu::Util::Number >> is copyright Toby Inkster. | ||||||||||
| 33 | |||||||||||
| 34 | It is free software; you may redistribute it and/or modify it under | ||||||||||
| 35 | the terms of either the Artistic License 1.0 or the GNU General Public | ||||||||||
| 36 | License version 2. | ||||||||||
| 37 | |||||||||||
| 38 | =cut | ||||||||||