Math::GMPq is a bigrational Perl module utilising the Gnu MP (GMP) library. Basically this module simply wraps all of the 'mpq' (rational number) functions provided by that library. The documentation below extensively plagiarises the GMP documentation (which can be found at http://gmplib.org). See also the Math::GMPq test suite for examples of usage.

SYNOPSIS

use Math::GMPq qw(:mpq);

my $str = '123542/4'; # numerator = 123542
# denominator = 4
my $base = 10;

# Create the Math::GMPq object
my $bn1 = Rmpq_init(); # Value set to 0/1

# Assign a value.
Rmpq_set_str($str, $base);

# Remove any factors common to both numerator and
# denominator so that gcd(numerator, denominator) == 1.
Rmpq_canonicalize($bn1);

# or just use the new() function:
my $rational = Math::GMPq->new('1234/1179');

# Perform some operations ... see 'FUNCTIONS' below.

.
.

# print out the value held by $bn1 (in octal):
print Rmpq_get_str($bn1, 8), "
"; # prints '170513/2'

# print out the value held by $bn1 (in decimal):
print Rmpq_get_str($bn1, 10); # prints '61771/2'.

# print out the value held by $bn1 (in base 29). The CPAN Search Site - search.cpan.org.

Similar software

#Calculation Component
(Popularity: )
:
#Calculation component is a powerful calculation engine for your applications. This ActiveX component integrates expression parsing and evaluation. Generally speaking, #Calculation is very useful in two main areas: first, when a formula has to be defined and evaluated at runtime ... Math::Symbolic::Operator
(Popularity: )
:
Math::Symbolic::Operator is a Perl module with operators in symbolic calculations.

SYNOPSIS

use Math::Symbolic::Operator;

my $sum = Math::Symbolic::Operator->new('+', $term1, $term2);

# or:
my $division =
Math::Symbolic::Operator->new(
{
type => B_DIVISON,
operands => [$term1, $term2],
}
);

my $derivative =
Math::Symbolic::Operator->new(
{
type ... Math::Symbolic::Constant
(Popularity: )
:
Math::Symbolic::Constant is a Perl module that offers constants in symbolic calculations.

SYNOPSIS

use Math::Symbolic::Constant;
my $const = Math::Symbolic::Constant->new(25);
my $zero = Math::Symbolic::Constant->zero();
my $one = Math::Symbolic::Constant->one();
my $euler = Math::Symbolic::Constant->euler();
# e = 2.718281828...

This module implements numeric constants for Math::Symbolic trees.. ... Math::Symbolic::Custom::Transformation
(Popularity: )
:
Math::Symbolic::Custom::Transformation is a Perl extension to the Math::Symbolic module. You're assumed to be remotely familiar with that module throughout the documentation.

This package implements transformations of Math::Symbolic trees using Math::Symbolic trees. I'll try to explain what this means in the following ... Math::Logic
(Popularity: )
:
Math::Logic is a Perl module that provides pure 2, 3 or multi-value logic.

use Math::Logic ':NUM' ; # $TRUE $FALSE $UNDEF -- what you normally want

use ... Math::Symbolic::Variable
(Popularity: )
:
Math::Symbolic::Variable is a Perl module which implements variables in symbolic calculations.

SYNOPSIS

use Math::Symbolic::Variable;

my $var1 = Math::Symbolic::Variable->new('name');
$var1->value(5);

my $var2 = Math::Symbolic::Variable->new('x', 2);

my $var3 =
Math::Symbolic::Variable->new(
{
name => 'variable',
value => 1,
}
);

This class implements variables for ... Math::MPC
(Popularity: )
:
A multiple precision complex number module utilising the MPC library. Basically, this module simply wraps the 'mpc' complex number functions provided by that library. Operator overloading is also available.

Math::MPC is a Perl module that needs the MPC, MPFR and GMP ... zfuncs
(Popularity: )
:
The zfuncs package contains various utility programs that were used in building the other applications on the kornelix.squarespace.com website. These programs are also included with the other applications. This package includes documentation that will make it easier to use these ... Array::Window
(Popularity: )
:
Many applications require that a large set of results be broken down into a smaller set of 'windows', or 'pages' in web language. Array::Window is a Perl module that implements an algorithm specifically for dealing with these windows. It is ... uncertainties for Linux
(Popularity: )
:
uncertainties is a Python module that allows calculation such as (0.2 +- 0.01)**2 = 0.04 +- 0.004 to be performed transparently.

Correlations between expressions are correctly taken into account (x-x is exactly zero, for instance).

Correlations between expressions are correctly taken into ... mid
(Popularity: )
:
mid is a tabbed dictionary browser using the language dictionary resources of the Internet.

mid stands for Mozilla Internet Dictionary.

You can start Mid from your Firefox's Tools menu.

You can also add a toolbar button for easier access: After installing and restarting ... MegaLauncher
(Popularity: )
:
MegaLauncher is a screenlet which has 6 launchers with personalized icons that executes the commands that you want. It's similar to the Launcher Screenlet that cames with the screenlet app, but the difference that this have six launchers in one.

Developer ...

User reviews

Similar scripts

Math Addition Test
(Popularity: ) : Math Addition Test is, as it's name suggests a flash application in which random addition questions are given which must be answered within a given time frame. At the end of the test, a report card is generated showing your ... Math Questions Generator
(Popularity: ) : This script is a short math questions generator to exercise your brain. Question is XxY=A, X Y=B; X=? Y=?. Math Function in 3D Graphics
(Popularity: ) : Math Function in 3D Graphics code shows the 3D representation of a math function. Rapid Math Trainer
(Popularity: ) : Rapid Math Trainer is a tiny Flash ActionScript Speed math program to train rapid multiplication and addition.Good for any age who wants to improve arithmetic and general maths skills. Quick mathematics is useful. com.wis.math.alg.Complex class
(Popularity: ) : Implements the static behaviours of the Complex Class, with algorithm logic based on the use of reverse Polish notation. Supports all functions pertaining to the complex number calculator and three added functions that are beyond the calculator's scope. The calculator ... Math Class Grade
(Popularity: ) : Math Class Grade allows you to calculate your grades obtained. Extended math library
(Popularity: ) : Extended math library extends Ruby's built-in math capabilities by providing additional constants and functions that a good scientific calculator should provide. com.wis.math.alg.Eval
(Popularity: ) : Implements the behaviours of the Eval Class. Provides methods for parsing string expression input, but is restricted to addition, subtraction, multiplication, division, and modulo operations. It supports parenthesized operation precedence as well as normal arithmetic precedence. Bitwise operations will be ... Math Program
(Popularity: ) : It is a simple math program that tests your math capabilities in any level of difficulty and in the basic areas of math (addition, subtraction, division and multiplication).It also provides immediate feedback when you answer questions. com.wis.math.num.Stat
(Popularity: ) : Implements the static behaviours of the Stat Class, which deals with Probability and Statistics math algorithms.usage:Stat.classMethod(args);