PPI
view release on metacpan or search on metacpan
lib/PPI/Token/Number/Exp.pm view on Meta::CPAN
=head2 literal
Return the numeric value of this token.
=cut
sub literal {
my $self = shift;
return if $self->{_error};
my ($mantissa, $exponent) = split m/e/i, $self->_literal;
my $neg = $mantissa =~ s/^\-//;
$mantissa =~ s/^\./0./;
$exponent =~ s/^\+//;
# Must cast exponent as numeric type, due to string type '00' exponent
# creating false positive condition in for() loop below, causing infinite loop
$exponent += 0;
# This algorithm is reasonably close to the S_mulexp10()
# algorithm from the Perl source code, so it should arrive
( run in 1.131 second using v1.01-cache-2.11-cpan-71847e10f99 )