From 7b639f1ec70e1e3a08bc30243877fc60cd029e9e Mon Sep 17 00:00:00 2001 From: martijnhoekstra Date: Fri, 30 Oct 2015 12:21:50 +0100 Subject: add doc for log, sqrt It's useful to know that log is the natural logarithm, not 10log or 2log or so. Also did sqrt "while I was at it" --- src/library/scala/math/package.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/library/scala/math/package.scala b/src/library/scala/math/package.scala index 58ece8a05b..631648eba4 100644 --- a/src/library/scala/math/package.scala +++ b/src/library/scala/math/package.scala @@ -58,7 +58,21 @@ package object math { * logarithms. */ def exp(x: Double): Double = java.lang.Math.exp(x) + + /** Returns the natural logarithm of a `double` value. + * + * The natural logarithm is the logarithm base Euler's number `e`. + * + * @param x the number to take the natural logarithm of + * @return the value `ln(x)` where ln is the natural lograrithm + */ def log(x: Double): Double = java.lang.Math.log(x) + + /** Returns the square root of a `double` value. + * + * @param x the number to take the square root of + * @return the value √x + */ def sqrt(x: Double): Double = java.lang.Math.sqrt(x) def IEEEremainder(x: Double, y: Double): Double = java.lang.Math.IEEEremainder(x, y) -- cgit v1.2.3