NAME

Clownfish::Integer - Immutable 64-bit signed integer.

SYNOPSIS

my $integer = Clownfish::Integer->new(7);
my $value = $integer->get_value;

DESCRIPTION

CONSTRUCTORS

new

my $integer = Clownfish::Integer->new($value);

Return a new Integer.

  • value - Initial value.

METHODS

get_value

$integer->get_value();

Return the value of the Integer.

to_f64

$integer->to_f64();

Convert the Integer to floating point.

compare_to

$integer->compare_to($other);

Indicate whether one number is less than, equal to, or greater than another. Throws an exception if other is neither an Integer nor a Float.

Returns: 0 if the numbers are equal, a negative number if self is less than other, and a positive number if self is greater than other.

clone

$integer->clone();

Return a clone of the object.

INHERITANCE

Clownfish::Integer isa Clownfish::Obj.