Sample code using giantint:
#include <stdio.h> #include "giants.h" main() { giant a; giant b; a = newgiant(INFINITY); b = newgiant(INFINITY); gread(a,stdin); gread(b,stdin); mulg(a,b); gout(b); }
Crandall comments that giantint is ``an older, 16-bit-digit package'' and says that he is working on a faster package, giants2000.
Old timings of giantint (no clear version number; marked 17 Apr 99 in giants.c) with gcc -O6 -fomit-frame-pointer -c giants.c on a Pentium II:
1: 24292 538 377 364 364 342 2: 342 342 342 342 342 342 4: 342 342 342 342 342 342 8: 342 342 342 342 342 342 16: 429 389 380 380 380 380 32: 565 523 504 496 496 496 64: 835 769 739 728 728 728 128: 1486 1455 1435 1435 1435 1435 256: 3565 3576 3559 3559 3559 3559 512: 11327 11330 11312 11309 11309 11309 1024: 88570 41277 40899 40860 40840 40825 2048: 183316 135261 134977 134941 134941 142002 4096: 502175 441041 439584 439551 439537 439539 8192: 963491 911419 905308 905197 905151 910576 16384: 2079586 1996162 1968131 1999582 1957114 1977321 32768: 5894983 5695481 5713409 5920069 11964467 6079784 65536: 12657304 12250049 12259679 12485573 12320163 12304028 131072: 27040421 27339684 27327872 27473888 27327708 27506484 262144: 62406371 60178331 60441868 60632417 60765029 59117373 524288: 144473425 147377054 144731134 140191782 139131190 140316374 1048576: 348659855 345259632 347602973 341351134 341452198 345685238 2097152: 792952570 787842792 805224485 804452370 787595806 782607498