Math::GoldenBigMath - Verified Big Real Number Calcualtion With Operators + - * / %
This documentation refers to version 0.804 of Math::GoldenBigMath
use Math::GoldenBigMath; $a = new Math::GoldenBigMath("3"); $b = new Math::GoldenBigMath("4.1e+0"); $sum = $a + $b; # 7.1 "+71e-1" $diff = $a - $b; # -1.1 "-11e-1" $mul = $a * $b; # 12.3 "+123e-1" print "$a + $b = $sum\n"; print "$a - $b = $diff\n"; print "$a * $b = $mul\n"; $a->Simplify(); # get back to optimal exponent print "$a\n"; print '3 <=> 4.1: '.($a <=> $b)."\n"; print '3 > 4.1: '.($a > $b)."\n"; print '3 >= 4.1: '.($a >= $b)."\n"; print '3 < 4.1: '.($a < $b)."\n"; print '3 <= 4.1: '.($a <= $b)."\n"; print '3 == 4.1: '.($a == $b)."\n"; print '3 == 3: '.($a == $a)."\n";
This module implements the algorithms I (and all other german childrens) learned in my school, in german called "Schriftliches Rechnen". That means exact calculation with pencil and paper, before computers or electronical calculators come up.
All of these alogrithms are exact, simple, well known and mathematical completely proven. But they are not very fast, even for computers.
So GoldenBigMath can be used for calculation, if high speed is not necessary or you have time to wait for the results.
It was designed to be used as a golden device to check all the other existing libraries handling big numbers, which are fast and complicated and so can contain errors.
Later on GoldenBigMath shell be proved by many other developers to get a verification of correctness in that sense, if you get a result, that the result is correct. But there is still the possibility not to get a result, because of programming problems, memory problems or you can't wait several years for the algorithm to finsh calculation...
More description will follow...
Division is deactivated, because it is not possible for floats yet but will come, when I have time to implement it.
Create one or more GoldenBigMath and use operators for calculation:
+ - * / %
<=> < <= > >= == !=
More description will follow... See SYNOPSIS
Ralf Peine, firstname.lastname@example.org
Copyright (c) 2011-2013 by Ralf Peine. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.0 or, at your option, any later version of Perl 5 you may have available.
This library is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.