NAME
Math::NumOnly - Disallow numeric operations that don't involve an IV or NV
|
DESCRIPTION
This disallowance of numeric operations applies only to operations that
involve one (or more) Math::NumOnly objects.
Arithmetic in which none of the operands are Math::NumOnly objects will still
proceed as per the normal rules.
It's unclear to me whether an operation between a Math::NumOnly object and some
other object (eg Math::BigInt, Math::GMP, Math::MPFR) should be allowed.
As it currently stands, such operations are not permitted.
It's just a silly, fun diversion - probably of little ( if any) value.
|
SYNOPSIS
my $a = Math::NumOnly->new(123.5);
my $b = $a + 42;
$b += 34.5;
print $b , "\n" ;
$pv = '3' ;
$iv = $pv + 7;
$c = Math::NumOnly( $iv );
|
FUNCTIONS
my $ok = is_ok( $arg );
This function is not exported but can be accessed as Math::NumOnly( $arg ).
It returns true if $arg is allowed to be used in an arithmetic
operation with a Math::NumOnly object.
Else it returns false.
No other functions are provided, except for the subs that are responsible
for overloading the '+' , '-' , '*' , '/' , '**' , '++' , '--' , '>=' , '<=' ,
'==' , '!=' , '>' , '<' , '<=>' , '""' , '+=' , '-=' , '*=' , '/=' , '**=' and
perhaps other operations.
|
LICENSE
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
Copyright 2023, Sisyphus
|
AUTHOR
Sisyphus <sisyphus at(@) cpan dot (.) org>
|