Main > Programming > Libraries >

Math::Numbers 0.000000001

Math::Numbers 0.000000001

Sponsored Links

Math::Numbers 0.000000001 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.004 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 838
Date added: 2007-07-13
Publisher: David Moreno Garza

Math::Numbers 0.000000001 description

Math::Numbers is a Perl module that contains methods for mathematical approaches of concepts of the number theory.

SYNOPSIS

use Math::Numbers;

my $a = 123;
my $b = 34;

my $numbers = Math::Numbers->new($a, $b [, ...]);

print "They are coprimes (relatively primes)!n" if $numbers->are_coprimes;
print "The greatest common divisor of these at least two numbers is ", $numbers->gcd;

my $number = Math::Numbers->new($a);

print "It is prime!n" if $number->is_prime;

my @divisors = $number->get_divisors;

print "$a is divisor of $b!n" if $number->is_divisor_of($b);

Math::Numbers is quite a simple module on matters of programming. What its interesting is the focus and approach it is intended to be made from the Number Theory basis for Perl beginners (like me) and also for young mathematicians (like me).

The normal topics of Number Theory include divisibility, prime numbers (which is separately intended to be covered by Math::Primes), congruences, quadratic residues, approximation for Real numbers, diophantine equations, etc. and all this is intended to be convered by the module on the concept on getting and setting values and also retriving the proof methods.

METHODS

new

# Some methods require more than only one argument.
my $numbers = Math::Numbers->new($p, $q, ...);

# Some methods require only one.
my $number = Math::Numbers->new($p);

Create a Math::Numbers object. Note that some of the methods will require objects created with only one or a defined numbers of arguments.

gcd
my $gcd = $numbers->gcd;

Calculation of the Greatest Common Divisor. This is made by two different methods which are described below: Blutos algorithm and Euclidean algorithm: The former is used when computing GCD for more than two integers; the latter is used when getting the GCD for two numbers to improve speed. See below for information on each.

Bluto_algorithm

You will mostly not require to call this method, but directly gcd(). Blutos algorithm uses a brute force calculation used by mathematicians to get divisors and then GCD also called Primality Test. Bluto takes some spinaches stolen from Popeye and starts dividing m all the way through 2 to m/2.

Euclidean_algorithm

Euclid rocks. I have a very nice Budgerigar (http://en.wikipedia.org/wiki/Budgerigar) called the same in honor of him (have to upload a pic of him).

As of now, this algorithm is only computed on two integers. From the Wikipedia entry: Given two natural numbers a and b: check if b is zero; if yes, a is the gcd. If not, repeat the process using (respectively) b, and the remainder after dividing a by b. This is exactly what our method does.
is_divisor_of

print "Yes, $p is divisor of $a...n" if $number->is_divisor_of($a);

Lets see if the number from the object is a divisor of $a, which means that the division $number/$a will return an integer (not necesarily a natural). If it does, itll return 1; 0, otherwise.

get_divisors
my @divisors = $number->get_divisors;

What are the divisors of the number brought by the object? This only includes the Natural numbers.

is_prime
print "$p is not prime!n" unless $number->is_prime

Returns 0 or 1 if the number from the object is prime or not, respectively. This method uses the, a bit slow, primality test.

are_coprimes
print "They are coprimes because their GCD is 1!n" if $numbers->are_coprimes;

Are the numbers from the object coprimes (relatively primes)? This means, the GCD is 1; (a, b, c, ...) = 1. Returns 1 or 0.

Math::Numbers 0.000000001 Screenshot

Advertisements

Math::Numbers 0.000000001 Keywords

Bookmark Math::Numbers 0.000000001

Hyperlink code:
Link for forum:

Math::Numbers 0.000000001 Copyright

WareSeeker periodically updates pricing and software information of Math::Numbers 0.000000001 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Math::Numbers 0.000000001 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Scalar::Number is a Perl module with numeric aspects of scalars. Free Download
Math::NumberCruncher Perl module contains a collection of useful math-related functions. Free Download
Math::GSL is a Perl module for the GNU Scientific Library. Free Download
Math::Combinatorics is a Perl module that can perform combinations and permutations on lists. Free Download
Number::Interval is a Perl module that can implement a representation of a numeric interval. Free Download
Math::BigRat package arbitrary big rational numbers. Free Download
Math::Expr is a Perl module that parses mathematical expressions. Free Download
Math::ODE Perl module allows you to solve N-th Order Ordinary Differential Equations with as little pain as possible. Free Download