_methods

trait _methods

Byte Extension Methods

Extension methods universaly avaialble for type scala.Byte

Source
_methods.scala
class java.lang.Object
trait scala.Matchable
class Any

Def

@targetName("range")
inline def <>(to: Byte): Byte.Range

Range

Range

Returns Byte.Range from current to given value

 (1.Byte <> 10.Byte).tp  // Prints  1 <> 10
Source
_methods.scala
@targetName("rangeOfSize")
inline def <>=(size: Int): Byte.Range

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")
inline def <>>(to: Byte): Byte.Range

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")
inline def ?: Byte.Opt

To option

To option

Returns Byte.Opt for current value

 val o : Byte.Opt = 12.Byte.?
Source
_methods.scala
inline def max(v: Byte): Byte

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
inline def min(v: Byte): Byte

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
inline def roundTo(unit: Int)(using r: Math.Rounding): Byte

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
inline def toByte: Byte

Make Byte

Make Byte

Returns underlying value

Source
_methods.scala
inline def toChar: Char

Make Char

Make Char

Attached Char constructor

Source
_methods.scala
inline def toDouble: Double

Make Double

Make Double

Attached Double constructor

Source
_methods.scala
inline def toFloat: Float

Make Float

Make Float

Attached Float constructor

Source
_methods.scala
inline def toInt: Int

Make Int

Make Int

Attached Int constructor

Source
_methods.scala
inline def toLong: Long

Make Long

Make Long

Attached Long constructor

Source
_methods.scala
inline def toNumber: java.lang.Byte

Make Number

Make Number

Attached Number constructor

Source
_methods.scala
inline def toShort: Short

Make Short

Make Short

Attached Short constructor

Source
_methods.scala