diff options
author | martijnhoekstra <martijnhoekstra@gmail.com> | 2015-10-30 12:21:50 +0100 |
---|---|---|
committer | martijnhoekstra <martijnhoekstra@gmail.com> | 2015-10-30 12:21:50 +0100 |
commit | 7b639f1ec70e1e3a08bc30243877fc60cd029e9e (patch) | |
tree | 92da70547719f53a93b665ba10606ea5499aaab6 /src/library | |
parent | a24ca7fa617cabada82c43d2d6ac354db698d181 (diff) | |
download | scala-7b639f1ec70e1e3a08bc30243877fc60cd029e9e.tar.gz scala-7b639f1ec70e1e3a08bc30243877fc60cd029e9e.tar.bz2 scala-7b639f1ec70e1e3a08bc30243877fc60cd029e9e.zip |
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"
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/math/package.scala | 14 |
1 files changed, 14 insertions, 0 deletions
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) |