Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.286.015 Times

Math::Numbers 0.000000001

  Date Added: September 13, 2010  |  Visits: 1.199

Math::Numbers

Report Broken Link
Printer Friendly Version


Product Homepage
Download (104 downloads)



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..

Requirements: No special requirements
Platforms: Linux
Keyword: Divisor Gcd Libraries Mathnumbers Methods Number Numbers Perl Module Prime Programming
Users rating: 0/10

License: Freeware Size: 4.1 KB
USER REVIEWS
More Reviews or Write Review


MATH::NUMBERS RELATED
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Libraries  -  perlfaq3 5.8.8
perlfaq3 Perl module contains programming tools. How do I do (anything)? Have you looked at CPAN (see perlfaq2)? The chances are that someone has already written a module that can solve your problem. Have you read the appropriate manpages?...
12.2 MB  
Libraries  -  Math::BaseCalc 1.011
Math::BaseCalc is a Perl module that can convert numbers between various bases. SYNOPSIS use Math::BaseCalc; my $calc = new Math::BaseCalc(digits => [0,1]); #Binary my $bin_string = $calc->to_base(465); # Convert 465 to binary...
4.1 KB  
Libraries  -  Mac::Errors 1.13
Mac::Errors is a Perl module with constants for Mac error codes. SYNOPSIS use Mac::Errors qw(openErr); if( $value == openErr ) { ... } my $error = $MacErrors{ $symbol }; # -- OR -- my $error = $MacErrors{ $number }; my $symbol =...
54.27 KB  
Libraries  -  Template::Alloy::VMethod 1.006
Template::Alloy::VMethod is a Perl module with VMethod role. The Template::Alloy::VMethod role provides all of the extra vmethods, filters, and virtual objects that add to the base featureset of Template::Alloy. Most of the vmethods listed here...
143.36 KB  
Science  -  Bio::Parse::SwissProt - perl module 0.5
A Perl module that provides methods for retrieving each and every field from a standard SwissProt file.
9.61 KB  
Programming  -  Perl Module Manager 1.2.0.18
Perl Module Manager helps you to install, un-install and manage Perl modules from a CPAN site and other sources in an easy and intuitive way. Allows you to search through thousands of useful modules and libraries on a CPAN site and its mirrors....
1.44 MB  
Libraries  -  Scrape::USPS::ZipLookup Perl Module 2.4
The United States Postal Service (USPS) has on its web site an HTML form at http://www.usps.com/zip4/ for standardizing an address. Given a firm, urbanization, street address, city, state, and zip, it will put the address into standard form...
11.26 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB