NAME
ScalarTypes::NumericTypes - Perl extension for identifyling special types of numbers
SYNOPSIS
use ScalarTypes::NumericTypes;
# Declare the teststring.
my $teststring = undef;
# Test unsigned integer.
$teststring = "12345678";
$testresult = is_unsigned_int($teststring); # Returns 1 (true) otherwise 0 (false)
print $testresult . "\n";
# Test signed integer.
$teststring = "-12345678";
$testresult = is_signed_int($teststring); # Returns 1 (true) otherwise 0 (false)
print $testresult . "\n";
# Test unsigned float.
$teststring = "1234.5678";
$testresult = is_unsigned_float($teststring); # Returns 1 (true) otherwise 0 (false)
print $testresult . "\n";
# Test signed float.
$teststring = "+1234.5678";
$testresult = is_signed_float($teststring); # Returns 1 (true) otherwise 0 (false)
print $testresult . "\n";
DESCRIPTION
is_unsigned_int()
Allowed integer is '12345678'. Not allowed integer is '01234567'.
is_signed_int()
Allowed integer is '+12345678'. Not allowed integer is '-01234567'.
is_unsigned_float()
Allowed float is '1234.5678'. Not allowed float are '0123.4567', '.1234' or '0.'.
is_signed_float()
Allowed float is '-1234.5678'. Not allowed float are '+0123.4567', '-.1234' or '+0.'.
SEE ALSO
Regular Expressions
AUTHOR
Dr. Peter Netz, <ztenretep@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2022 by Dr. Peter Netz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.30.0 or, at your option, any later version of Perl 5 you may have available.