Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
Introduction to GMP
Maple uses the GMP library to perform arbitrary-precision integer arithmetic. For more information about GMP, see ?gmp.
Arbitrary-precision integer arithmetic involves working with numbers that are too large to fit into hardware integers. In Maple, the greatest number that can be represented by hardware integer is given by
kernelopts(maximmediate);
Integers greater than the above are represented by software integers. Arithmetic for software integers requires special algorithms for large integer arithmetic. To illustrate exact arbitrary-precision integer arithmetic in Maple, consider the following examples.
Basic Integer Arithmetic
133!/2^31 + 141^41;
p := nextprime(%); # Find the smallest prime greater than the previous number
isprime(p);
igcd(p, 2*p); # Greatest common divisor of p and 2*p is p
Fermat's Little Theorem
Fermat's Little Theorem states "If p is prime and a is an integer, then a^p = a (mod p)"
Consider this Mersenne prime (that is, prime of the form 2^n-1), which is more than 600 digits long.
p := 2^2281-1:
Let a be a random integer between 2 and p-1.
a := rand(2..p-1)():
Verify the correctness of Fermat's Little Theorem.
evalb(a &^p mod p = a);
A Very Large Summation
This example demonstrates the improvement of Maple 9 with arbitrary-precision integer arithmetic with GMP. Maple 9 computes this summation 25 times faster than Maple 8 (tested on a Pentium 4 1.5 GHz)
S := add(1/k^2, k=1..100000):
You can verify that the above sum is computed correctly by using the knowledge that it asymptotically approaches Pi^2/6.
evalf(sqrt(6*S)); # This should be approximately Pi
Return to Index for Example Worksheets
Download Help Document