Apfloat is a high performance arbitrary precision arithmetic library which covers much the same ground as Java's BigDecimal and BigInteger, but performs a lot better with very big numbers, and includes a lot more mathematical functions as standard, such as nth roots, log(), exp(), and trigonometry (e.g. have a browse through the documentation for the ApfloatMath class).