@@ -120,7 +120,7 @@ object Duration {
120
120
def fromNanos (nanos : Double ): Duration = {
121
121
if (nanos.isInfinite)
122
122
if (nanos > 0 ) Inf else MinusInf
123
- else if (nanos .isNaN)
123
+ else if (JDouble .isNaN(nanos) )
124
124
Undefined
125
125
else if (nanos > Long .MaxValue || nanos < Long .MinValue )
126
126
throw new IllegalArgumentException (" trying to construct too large duration with " + nanos + " ns" )
@@ -196,11 +196,11 @@ object Duration {
196
196
}
197
197
198
198
def * (factor : Double ): Duration =
199
- if (factor == 0d || factor .isNaN) Undefined
199
+ if (factor == 0d || JDouble .isNaN(factor) ) Undefined
200
200
else if (factor < 0d ) - this
201
201
else this
202
202
def / (divisor : Double ): Duration =
203
- if (divisor .isNaN || divisor.isInfinite) Undefined
203
+ if (JDouble .isNaN(divisor) || divisor.isInfinite) Undefined
204
204
else if ((divisor compare 0d ) < 0 ) - this
205
205
else this
206
206
def / (divisor : Duration ): Double = divisor match {
@@ -627,13 +627,13 @@ final class FiniteDuration(val length: Long, val unit: TimeUnit) extends Duratio
627
627
628
628
def * (factor : Double ) =
629
629
if (! factor.isInfinite) fromNanos(toNanos * factor)
630
- else if (factor .isNaN) Undefined
630
+ else if (JDouble .isNaN(factor) ) Undefined
631
631
else if ((factor > 0 ) ^ (this < Zero )) Inf
632
632
else MinusInf
633
633
634
634
def / (divisor : Double ) =
635
635
if (! divisor.isInfinite) fromNanos(toNanos / divisor)
636
- else if (divisor .isNaN) Undefined
636
+ else if (JDouble .isNaN(divisor) ) Undefined
637
637
else Zero
638
638
639
639
// if this is made a constant, then scalac will elide the conditional and always return +0.0, SI-6331
0 commit comments