Class Ln


  • public class Ln
    extends Object
    Implementation of the natural logarithm function for BigDecimals.
    Author:
    Tilman Neumann
    • Constructor Detail

      • Ln

        public Ln()
    • Method Detail

      • ln2

        public static BigDecimal ln2​(Scale outScale)
        Faster ln2 implementation, computing the series expansion of 2^(1/k) for some optimally chosen k.
        Parameters:
        outScale - Wanted precision in after-comma decimal digits
        Returns:
        ln(2)
      • ln

        public static BigDecimal ln​(BigDecimal x,
                                    Scale outScale)
        Compute the natural logarithm of x, for x>0. This algorithm takes the reciprocal of x>1 and then uses the simple reduction, followed by an AGM reduction. The fastest algorithm for all number ranges.
        Parameters:
        x -
        outScale -
        Returns:
        ln(x)
      • main

        public static void main​(String[] argv)
        Test.
        Parameters:
        argv - ignored