You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.IndexOutOfBoundsException:3
at scala.collection.immutable.NumericRange.apply(NumericRange.scala:112)
at scala.collection.immutable.NumericRange$$anon$1.apply(NumericRange.scala:165)
at scala.collection.IndexedSeqLike$Elements.next(IndexedSeqLike.scala:65)
at scala.collection.IterableLike$class.copyToArray(IterableLike.scala:253)
at scala.collection.AbstractIterable.copyToArray(Iterable.scala:54)
at scala.collection.TraversableOnce$class.copyToArray(TraversableOnce.scala:263)
at scala.collection.AbstractTraversable.copyToArray(Traversable.scala:104)
at scala.collection.TraversableOnce$class.toArray(TraversableOnce.scala:271)
at scala.collection.AbstractTraversable.toArray(Traversable.scala:104)
The text was updated successfully, but these errors were encountered:
Shiti Saxena (Shiti) said (edited on Aug 6, 2014 7:04:14 AM UTC):
When using the to method to generate a Double Range, the result was is not the same as Range.Double.
I have noticed that Range.Double internally generates a Range using Range.BigDecimal and then converting it to Double (code) whereas FractionalProxy.to creates a NumericRange of Type Double,
Welcome to Scala 2.12.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_181).
Type in expressions for evaluation. Or try :help.
scala> Range.Double.inclusive(5.0,10.0,5.0/3.0).toArray
<console>:12: warning: method inclusive in object Double is deprecated (since 2.12.6): use Range.BigDecimal.inclusive instead
Range.Double.inclusive(5.0,10.0,5.0/3.0).toArray
^
res0: Array[Double] = Array(5.0, 6.666666666666667, 8.333333333333334)
The following code snippet throws a NPE
The strackTrace is
The text was updated successfully, but these errors were encountered: