Permalink
Browse files

Better README. Deleted dead code.

  • Loading branch information...
1 parent 5f9e66b commit 1ab9bd01e7bab077fd8dcd9035c770015ae8fd0b @colomon committed Jan 29, 2011
Showing with 28 additions and 36 deletions.
  1. +28 −1 README
  2. +0 −35 lib/Math/BigInt.pm
View
29 README
@@ -1,2 +1,29 @@
This is an attempt to implement a BigInt class for Rakudo, to tide us over
-until Rakudo's Int class can handle arbitrary precision internally.
+until Rakudo's Int class can handle arbitrary precision internally.
+
+Installing:
+Math::BigInt is set up as a normal Perl 6 module. However, it has rather more
+prerequisites than normal:
+
+1) You must have Zavolaj installed and working.
+
+2) You must have the BigDigits routines installed as a dynamic libbd library
+on your system. The BigDigits source is available from
+http://www.di-mgt.com.au/bigdigits.html . However, it doesn't have any provision
+for making and installing the needed library. Right now you need to do this by
+hand. I hope to provide platform independent makefiles for this at some point.
+
+3) Right now it calls malloc, free, and strcat from libSystem. If you're on a
+platform other than OS X, you'll have to change this to the appropriate place
+to find those calls. (This is lines 15-17 in lib/Math/BigInt.pm.) Again, I
+hope to have a better workaround for this someday.
+
+Once all that is in place, this is easily built using the standard ufo tool:
+
+ufo
+make
+make test
+make install
+
+As of this writing, neither BigDigits nor Math::BigInts properly handles
+negative numbers. Hopefully this is a temporary limitation.
View
@@ -139,38 +139,3 @@ class Math::BigInt does Real {
$result.Int;
}
}
-
-
-
-# multi MAIN() {
-# my $a = Math::BigInt.new("131414212321313141");
-# say Math::BigInt.new("131414212321313141") + Math::BigInt.new("1000000000000000000000000000000");
-# my @crazy := Math::BigInt.new("1"), -> $x { $x * Math::BigInt.new("2") } ... *;
-# say ~@crazy[100];
-# my @crazier := Math::BigInt.new("1"), * + 1 ... *;
-# say [*] @crazier[^70];
-# say ([*] @crazier[^70]).log;
-# say $a * 2;
-# }
-#
-# multi MAIN("playing") {
-# my $a = bdNew();
-# my $b = bdNew();
-# my $c = bdNew();
-# bdConvFromDecimal($a, "43857389573984758937458347535");
-# bdConvFromDecimal($b, "1");
-# bdAdd($c, $a, $b);
-# # bdConvFromDecimal($b, "10");
-# # bdModulo($a, $c, $b);
-#
-# my $space = malloc(1000);
-# bdConvToDecimal($c, $space, 999);
-#
-# say strcat($space, "");
-#
-# free($space);
-#
-# bdFreeSol($a);
-# bdFreeSol($b);
-# bdFreeSol($c);
-# }

0 comments on commit 1ab9bd0

Please sign in to comment.