Calculates the natural logarithm ln (i.e loge) of a number and returns the result as a double.