diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-15 04:02:35 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-15 04:02:35 +0000 |
commit | 4383277103b8bc78244aff05d5116b07e70f2c2a (patch) | |
tree | cc3c66dd4dd1da779fb624478bce56bc125a6aaf /src/library | |
parent | e96dba0c9a2467c6cf396c70a48ef0750503c26e (diff) | |
download | scala-4383277103b8bc78244aff05d5116b07e70f2c2a.tar.gz scala-4383277103b8bc78244aff05d5116b07e70f2c2a.tar.bz2 scala-4383277103b8bc78244aff05d5116b07e70f2c2a.zip |
Addresses the issues swirling around Double.Eps...
Addresses the issues swirling around Double.Epsilon and friends which
were battled out in more than one venue and then aptly summarized by
retronym in #3791. Thanks to Simon Ochsenreither for submitting a patch;
I wasn't able to use too much of it because the source code for these
types is generated, but effort is always appreciated. Closes #3791, and
I'm tired and I'd hate to blow this one at this late date: review by
rytz.
Diffstat (limited to 'src/library')
-rwxr-xr-x | src/library/scala/Boolean.scala | 2 | ||||
-rw-r--r-- | src/library/scala/Byte.scala | 2 | ||||
-rw-r--r-- | src/library/scala/Char.scala | 2 | ||||
-rw-r--r-- | src/library/scala/Double.scala | 17 | ||||
-rw-r--r-- | src/library/scala/Float.scala | 17 | ||||
-rw-r--r-- | src/library/scala/Int.scala | 2 | ||||
-rw-r--r-- | src/library/scala/Long.scala | 2 | ||||
-rw-r--r-- | src/library/scala/Math.scala | 6 | ||||
-rw-r--r-- | src/library/scala/Short.scala | 2 | ||||
-rwxr-xr-x | src/library/scala/Unit.scala | 2 |
10 files changed, 34 insertions, 20 deletions
diff --git a/src/library/scala/Boolean.scala b/src/library/scala/Boolean.scala index d5e9eb950e..dc2076cb1d 100755 --- a/src/library/scala/Boolean.scala +++ b/src/library/scala/Boolean.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala diff --git a/src/library/scala/Byte.scala b/src/library/scala/Byte.scala index e3f4a82003..69d435b33b 100644 --- a/src/library/scala/Byte.scala +++ b/src/library/scala/Byte.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala diff --git a/src/library/scala/Char.scala b/src/library/scala/Char.scala index 3c3f292fd2..88d7617ea5 100644 --- a/src/library/scala/Char.scala +++ b/src/library/scala/Char.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala diff --git a/src/library/scala/Double.scala b/src/library/scala/Double.scala index cc4f597bda..fe37860c07 100644 --- a/src/library/scala/Double.scala +++ b/src/library/scala/Double.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala @@ -119,16 +119,23 @@ final class Double extends AnyVal { object Double extends AnyValCompanion { + /** The smallest positive value greater than 0.0d.*/ final val MinPositiveValue = jl.Double.MIN_VALUE - final val MinNegativeValue = -jl.Double.MAX_VALUE final val NaN = jl.Double.NaN final val PositiveInfinity = jl.Double.POSITIVE_INFINITY final val NegativeInfinity = jl.Double.NEGATIVE_INFINITY @deprecated("use Double.MinPositiveValue instead") - final val Epsilon = MinPositiveValue - @deprecated("use Double.MinNegativeValue instead") - final val MinValue = MinNegativeValue + final val Epsilon = MinPositiveValue + + /** The negative number with the greatest (finite) absolute value which is representable + * by a Double. Note that it differs from [[java.lang.Double.MIN_VALUE]], which + * is the smallest positive value representable by a Double. In Scala that number + * is called Double.MinPositiveValue. + */ + final val MinValue = -jl.Double.MAX_VALUE + + /** The largest finite positive number representable as a Double. */ final val MaxValue = jl.Double.MAX_VALUE def box(x: Double): jl.Double = jl.Double.valueOf(x) diff --git a/src/library/scala/Float.scala b/src/library/scala/Float.scala index 81b464078d..39e510e477 100644 --- a/src/library/scala/Float.scala +++ b/src/library/scala/Float.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala @@ -119,16 +119,23 @@ final class Float extends AnyVal { object Float extends AnyValCompanion { + /** The smallest positive value greater than 0.0f.*/ final val MinPositiveValue = jl.Float.MIN_VALUE - final val MinNegativeValue = -jl.Float.MAX_VALUE final val NaN = jl.Float.NaN final val PositiveInfinity = jl.Float.POSITIVE_INFINITY final val NegativeInfinity = jl.Float.NEGATIVE_INFINITY @deprecated("use Float.MinPositiveValue instead") - final val Epsilon = MinPositiveValue - @deprecated("use Float.MinNegativeValue instead") - final val MinValue = MinNegativeValue + final val Epsilon = MinPositiveValue + + /** The negative number with the greatest (finite) absolute value which is representable + * by a Float. Note that it differs from [[java.lang.Float.MIN_VALUE]], which + * is the smallest positive value representable by a Float. In Scala that number + * is called Float.MinPositiveValue. + */ + final val MinValue = -jl.Float.MAX_VALUE + + /** The largest finite positive number representable as a Float. */ final val MaxValue = jl.Float.MAX_VALUE def box(x: Float): jl.Float = jl.Float.valueOf(x) diff --git a/src/library/scala/Int.scala b/src/library/scala/Int.scala index 416512d43b..69fb0a66b7 100644 --- a/src/library/scala/Int.scala +++ b/src/library/scala/Int.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala diff --git a/src/library/scala/Long.scala b/src/library/scala/Long.scala index 25b6873e72..7fdefebae3 100644 --- a/src/library/scala/Long.scala +++ b/src/library/scala/Long.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala diff --git a/src/library/scala/Math.scala b/src/library/scala/Math.scala index 3d300b8259..a1663a6a02 100644 --- a/src/library/scala/Math.scala +++ b/src/library/scala/Math.scala @@ -13,7 +13,7 @@ package scala * operations such as the elementary exponential, logarithm, square root, and * trigonometric functions. */ -@deprecated("use scala.math package object instead.\n(Example package object usage: scala.math.Pi )") +@deprecated("use the scala.math package object instead.\n(Example package object usage: scala.math.Pi )") object Math extends MathCommon { @deprecated("Use scala.Byte.MinValue instead") val MIN_BYTE = java.lang.Byte.MIN_VALUE @@ -50,7 +50,7 @@ object Math extends MathCommon { val MIN_FLOAT = -java.lang.Float.MAX_VALUE /** The smallest difference between two values of <a href="Float.html" target="_self">scala.Float</a>. */ - @deprecated("Use scala.Float.Epsilon instead") + @deprecated("Use scala.Float.MinPositiveValue instead") val EPS_FLOAT = java.lang.Float.MIN_VALUE /** The greatest possible value for <a href="Float.html" target="_self">scala.Float</a>. */ @@ -74,7 +74,7 @@ object Math extends MathCommon { val MIN_DOUBLE = -java.lang.Double.MAX_VALUE /** The smallest difference between two values of <a href="Double.html" target="_self">scala.Double</a>. */ - @deprecated("Use scala.Double.Epsilon instead") + @deprecated("Use scala.Double.MinPositiveValue instead") val EPS_DOUBLE = java.lang.Double.MIN_VALUE /** The greatest possible value for <a href="Double.html" target="_self">scala.Double</a>. */ diff --git a/src/library/scala/Short.scala b/src/library/scala/Short.scala index abbb939c4c..df3e680575 100644 --- a/src/library/scala/Short.scala +++ b/src/library/scala/Short.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala diff --git a/src/library/scala/Unit.scala b/src/library/scala/Unit.scala index 7ef282a9ad..9e2d4dc616 100755 --- a/src/library/scala/Unit.scala +++ b/src/library/scala/Unit.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -// generated on Sun Jan 23 21:13:38 PST 2011 +// DO NOT EDIT, CHANGES WILL BE LOST. package scala |