Shlomi Fish > Math-GrahamFunction > Math::GrahamFunction::SqFacts

Download:
Math-GrahamFunction-0.02001.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Math::GrahamFunction::SqFacts - a squaring factors vector.

WARNING! ^

This is a module for Math::GrahamFunction's internal use only.

CONSTRUCTION ^

Math::GrahamFunction::SqFacts->new({n => $n})

Initializes a squaring factors object from a number.

Math::GrahamFunction::SqFacts->new({factors => \@factors})

Initializes a squaring factors object from a list of factors.

METHODS ^

$facts->clone()

Creates a clone of the object and returns it.

$n_facts->mult_by($m_facts)

Calculates the results of the multiplication of the number represented by $n_facts and $m_facts and stores it in $n_facts (destructively).

This is actually addition in vector space.

my $result = $n->mult($m);

Non destructively calculates the multiplication and returns it.

$facts->is_square()

A predicate that returns whether the factors represent a square number.

$facts->exists($myfactor)

Checks whether $myfactor exists in $facts.

my $last_factor = $factors->last()

Returns the last (and greatest factor).

$facts->product()

Returns the product of the factors.

$facts->first()

Returns the first (and smallest) factor.

AUTHOR ^

Shlomi Fish, <shlomif at cpan.org>

ACKNOWLEDGEMENTS ^

COPYRIGHT & LICENSE ^

Copyright 2007 Shlomi Fish, all rights reserved.

This program is released under the following license: MIT X11.

Note: the module meta-data says this module is released under the BSD license. However, MIT X11 is the more accurate license, and "bsd" is the closest option for the CPAN meta-data.

syntax highlighting: