_methods
trait _methods
Double Extension Methods
Extension methods universaly avaialble for type scala.Double
- Source
- _methods.scala
Def
@targetName("range")
Range
Range
Returns Double.Range from current to given value
(1.0 <> 10.0).tp // Prints 1.0 <> 10.0
- Source
- _methods.scala
@targetName("rangeX")
Exclusive end range
Exclusive end range
Returns Double.Range from current to given value exclusive
(1.0 <>> 10.0).tp // Prints 1.0 <>> 10.0
- Source
- _methods.scala
@targetName("Opt")
To option
To option
Returns Double.Opt for current value
val o : Double.Opt = 12.0.?
- Source
- _methods.scala
Max value
Max value
Returns maximum of current or given value
val v = 5F
v.max(0).tp // Prints 5.0
v.max(10).tp // Prints 10.0
- Source
- _methods.scala
Min value
Min value
Returns minimun of current or given value
val v = 5F
v.min(0).tp // Prints 0.0
v.min(10).tp // Prints 5.0
- Source
- _methods.scala
Round to size
Round to size
Rounds current value to specified size
91F.roundTo(5).tp // Prints 90.0
91F.roundTo(5)(using UP).tp // Prints 95.0
- Source
- _methods.scala
Round to decimal
Round to decimal
Rounds current value to specified decimal position of fractional value
- Source
- _methods.scala