Query: scalar::util::numeric
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Scalar::Util::Numeric(3pm) User Contributed Perl Documentation Scalar::Util::Numeric(3pm)NAMEScalar::Util::Numeric - numeric tests for Perl scalarsSYNOPSISuse Scalar::Util::Numeric qw(isnum isint isfloat); foo($bar / 2) if (isnum $bar); if (isint $baz) { # ... } elsif (isfloat $baz) { # ... }DESCRIPTIONThis module exports a number of wrappers around perl's builtin "grok_number" function, which returns the numeric type of its argument, or 0 if it isn't numeric.TAGSAll of the functions exported by Scalar::Util::Numeric can be imported by using the ":all" tag: use Scalar::Util::Numeric qw(:all);EXPORTSisnum isnum ($val) Returns a nonzero value (indicating the numeric type) if $val is a number. The numeric type is a conjunction of the following flags: 0x01 IS_NUMBER_IN_UV (number within UV range - not necessarily an integer) 0x02 IS_NUMBER_GREATER_THAN_UV_MAX (number is greater than UV_MAX) 0x04 IS_NUMBER_NOT_INT (saw . or E notation) 0x08 IS_NUMBER_NEG (leading minus sign) 0x10 IS_NUMBER_INFINITY (Infinity) 0x20 IS_NUMBER_NAN (NaN - not a number) isint isuv isbig isfloat isneg isinf isnan The following flavours of "isnum" (corresponding to the flags above) are also available: isint isuv isbig isfloat isneg isinf isnan "isint" returns -1 if its operand is a negative integer, 1 if it's 0 or a positive integer, and 0 otherwise. The others always return 1 or 0.SEE ALSOo "type" in autobox o Data::Types o Params::Classify o Params::Util o Scalar::Util o String::NumericVERSION0.22AUTHORSo chocolateboy <chocolate@cpan.org> o Michael G Schwern <schwern@pobox.com>COPYRIGHTCopyright (c) 2005-2010, chocolateboy. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. perl v5.14.2 2010-08-25 Scalar::Util::Numeric(3pm)
Related Man Pages |
---|
task::weaken(3) - suse |
task::weaken(3) - centos |
class::meta::types::numeric(3pm) - debian |
scalar::util::numeric(3pm) - debian |
task::weaken(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
How To Add Numeric Data of A file |
Check for Numeric output in Perl |
Numeric sort error |
How to check for a Numeric Value? |
Perl : Numeric Range Pattern Matching |