NAME
Hydrogen::Topic::Number - functions from Hydrogen::Number applied to $_
VERSION
This documentation is for Hydrogen::Topic::Number 0.012, which is based on Sub::HandlesVia::HandlerLibrary::Number 0.036.
FUNCTIONS
Each function implicitly operates on $_
, expecting it to be a numeric scalar.
abs()
Operates on $_
, which must be a numeric scalar.
Finds the absolute value of the current number, updating the original value.
add( $addend )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Adds a number to the existing number, updating the original value.
cmp( $num )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Returns $_ <=> $num
.
div( $divisor )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Divides the existing number by a number, updating the original value.
eq( $num )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Returns $_ == $num
.
ge( $num )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Returns $_ >= $num
.
get()
Operates on $_
, which must be a numeric scalar.
Returns the current value of the number.
gt( $num )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Returns $_ > $num
.
le( $num )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Returns $_ <= $num
.
lt( $num )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Returns $_ < $num
.
mod( $divisor )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Finds the current number modulo a divisor, updating the original value.
mul( $factor )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Multiplies the existing number by a number, updating the original value.
ne( $num )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Returns $_ != $num
.
set( $value )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Sets the number to a new value.
sub( $subtrahend )
Operates on $_
, which must be a numeric scalar.
Arguments: Num.
Subtracts a number from the existing number, updating the original value.
EXPORT
No functions are exported by this module by default. To import them all (this is usually a bad idea), use:
use Hydrogen::Topic::Number -all;
To import a particular function, use:
use Hydrogen::Topic::Number 'cmp';
To rename functions:
use Hydrogen::Topic::Number 'cmp' => { -as => 'myfunc' };
See Exporter::Tiny::Manual::Importing for more hints on importing.
BUGS
Please report any bugs to http://github.com/tobyink/p5-hydrogen/issues.
SEE ALSO
Hydrogen, Hydrogen::Number, Hydrogen::Curry::Number, Sub::HandlesVia::HandlerLibrary::Number.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
This software is copyright (c) 2022 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.