_methods

trait _methods

Short Extension Methods

Extension methods universaly avaialble for type scala.Short

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

Def

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

Range

Range

Returns Short.Range from current to given value

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

Range by size

Range by size

Returns Short.Range starting at current value and with given size

 (5.Short <>= 10).tp  // Prints 5 <> 14
Source
_methods.scala
@targetName("rangeX")
inline def <>>(to: Short): Short.Range

Exclusive end range

Exclusive end range

Returns Short.Range from current to given value exclusive

 (1.Short <>> 10.Short).tp  // Prints  1 <> 9
Source
_methods.scala
@targetName("Opt")
inline def ?: Short.Opt

To option

To option

Returns Short.Opt for current value

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

Max value

Max value

Returns maximum of current or given value

 val b = 5.Short

 b.max(0).tp   // Prints 5

 b.max(10).tp  // Prints 10
Source
_methods.scala
inline def min(v: Short): Short

Min value

Min value

Returns minimun of current or given value

 val b = 5.Short

 b.min(0).tp   // Prints 0

 b.min(10).tp  // Prints 5
Source
_methods.scala
inline def roundTo(unit: Int)(using r: Math.Rounding): Short

Round to size

Round to size

Rounds current value to specified size

 91.Short.roundTo(5).tp            // Prints 90

 91.Short.roundTo(5)(using UP).tp  // Prints 95
Source
_methods.scala
inline def toByte: Byte

Make Byte

Make Byte

Attached Byte constructor

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.Short

Make Number

Make Number

Attached Number constructor

Source
_methods.scala
inline def toShort: Short

Make Short

Make Short

Returns underlying value

Source
_methods.scala