Bubblegum

 view release on metacpan or  search on metacpan

lib/Bubblegum/Object/Number.pm  view on Meta::CPAN

# ABSTRACT: Common Methods for Operating on Numbers
package Bubblegum::Object::Number;

use 5.10.0;
use namespace::autoclean;

use Bubblegum::Class 'with';
use Bubblegum::Constraints -isas, -types;

with 'Bubblegum::Object::Role::Coercive';
with 'Bubblegum::Object::Role::Value';

our @ISA = (); # non-object

our $VERSION = '0.45'; # VERSION

sub abs {
    my $self = CORE::shift;
    return CORE::abs $self;
}

sub atan2 {
    my $self = CORE::shift;
    my $x    = type_number CORE::shift;
    return CORE::atan2 $self, $x;
}

sub cos {
    my $self = CORE::shift;
    return CORE::cos $self;
}

sub decr {
    my $self = CORE::shift;
    my $n    = type_number CORE::shift if $_[0];
    return $self - ($n || 1);
}

sub exp {
    my $self = CORE::shift;
    return CORE::exp $self;
}

sub hex {
    my $self = CORE::shift;
    return CORE::sprintf '%#x', $self;
}

sub incr {
    my $self = CORE::shift;
    my $n    = type_number CORE::shift if $_[0];
    return $self + ($n || 1);
}

sub int {
    my $self = CORE::shift;
    return CORE::int $self;
}

sub log {
    my $self = CORE::shift;
    return CORE::log $self;
}

sub mod {



( run in 1.606 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )