_methods
trait _methods
Long Extension Methods
Extension methods universaly avaialble for type scala.Long
- Source
- _methods.scala
Def
@targetName("range")
Range
Range
Returns Long.Range from current to given value
(1L <> 10L).tp // Prints 1 <> 10
- Source
- _methods.scala
@targetName("rangeOfSize")
Range by size
Range by size
Returns Long.Range starting at current value and with given size
(5L <>= 10L).tp // Prints 5 <> 14
- Source
- _methods.scala
@targetName("rangeX")
Exclusive end range
Exclusive end range
Returns Long.Range from current to given value exclusive
(1L <>> 10L).tp // Prints 1 <> 9
- Source
- _methods.scala
@targetName("Opt")
To option
To option
Returns Long.Opt for current value
val o : Long.Opt = 12L.?
- Source
- _methods.scala
Max value
Max value
Returns maximum of current or given value
val v = 5L
v.max(0).tp // Prints 5
v.max(10).tp // Prints 10
- Source
- _methods.scala
Min value
Min value
Returns minimun of current or given value
val v = 5L
v.min(0).tp // Prints 0
v.min(10).tp // Prints 5
- Source
- _methods.scala
Round to size
Round to size
Rounds current value to specified size
91L.roundTo(5).tp // Prints 90
91L.roundTo(5)(using UP).tp // Prints 95
- Source
- _methods.scala