Scalar::NumberScalar::Number is a Perl module with numeric aspects of scalars. | |
Download |
Scalar::Number Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Andrew Main
- Publisher web site:
- http://search.cpan.org/~zefram/
Scalar::Number Tags
Scalar::Number Description
Scalar::Number is a Perl module with numeric aspects of scalars. Scalar::Number is a Perl module with numeric aspects of scalars.SYNOPSIS use Scalar::Number qw(scalar_num_part); $num = scalar_num_part($scalar); use Scalar::Number qw(sclnum_is_natint sclnum_is_float); if(sclnum_is_natint($value)) { ... if(sclnum_is_float($value)) { ... use Scalar::Number qw(sclnum_val_cmp sclnum_id_cmp); @sorted_nums = sort { sclnum_val_cmp($a, $b) } @floats; @sorted_nums = sort { sclnum_id_cmp($a, $b) } @floats;This module is about the numeric part of plain (string) Perl scalars. A scalar has a numeric value, which may be expressed in either the native integer type or the native floating point type. Many values are expressible both ways, in which case the exact representation is insignificant. To fully understand Perl arithmetic it is necessary to know about both of these representations, and the differing behaviours of numbers according to which way they are expressible.This module provides functions to extract the numeric part of a scalar, classify a number by expressibility, and compare numbers across representations. Requirements: · Perl
Scalar::Number Related Software