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