fomkin commented on a change in pull request #17503: Add Scala 2.12 and 2.13 
cross-compilation (#16438)
URL: https://github.com/apache/incubator-mxnet/pull/17503#discussion_r378708695
 
 

 ##########
 File path: 
scala-package/core/src/test/scala/org/apache/mxnet/NDArraySuite.scala
 ##########
 @@ -357,24 +357,24 @@ class NDArraySuite extends FunSuite with 
BeforeAndAfterAll with Matchers {
       val step = scala.util.Random.nextFloat() * 4
       val repeat = 1
 
-      val result1 = (start.toDouble until stop.toDouble by step.toDouble)
+      val result1 = (BigDecimal(start) until BigDecimal(stop) by 
BigDecimal(step))
         .flatMap(x => Array.fill[Float](repeat)(x.toFloat))
       val range1 = NDArray.arange(start = start, stop = Some(stop), step = 
step,
         repeat = repeat)
       assert(CheckUtils.reldiff(result1.toArray, range1.toArray) <= 1e-4f)
 
-      val result2 = (0.0 until stop.toDouble by step.toDouble)
+      val result2 = (BigDecimal(0.0) until BigDecimal(stop) by 
BigDecimal(step))
         .flatMap(x => Array.fill[Float](repeat)(x.toFloat))
       val range2 = NDArray.arange(stop, step = step, repeat = repeat)
       assert(CheckUtils.reldiff(result2.toArray, range2.toArray) <= 1e-4f)
 
-      val result3 = 0f to stop by 1f
+      val result3 = (BigDecimal(0) until BigDecimal(stop) by 
BigDecimal(1)).map(_.toFloat)
 
 Review comment:
   Thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to