_methods

trait _methods

Short Extension Methods

Extension methods universaly avaialble for type scala.Short

Source
_methods.scala
trait Short.Z.ToPrimitives[Short]
class java.lang.Object
trait scala.Matchable
class Any

Def

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

Range

Range

Returns Short.<> from current to given value

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

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
@scala.annotation.targetName("rangeX")
inline def <>>(inline to: Short): Short.<>

Exclusive end range

Exclusive end range

Returns Short.<> from current to given value exclusive

 (1.Short <>> 10.Short).tp  // Prints  1 <> 9
Source
_methods.scala
@scala.annotation.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 atLeast(v: Short): Short

Max

Max

Returns maximum of current or given value

 val b = 5.Short

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

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

Min

Min

Returns minimun of current or given value

 val b = 5.Short

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

 b.atMost(10).tp  // Prints 5
Source
_methods.scala
inline def roundTo(inline size: Int)(using r: 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

Make

inline def Byte: Byte

Make Byte

Make Byte

Attached Byte constructor

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Char: Char

Make Char

Make Char

Attached Char constructor

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Double: Double

Make Double

Make Double

Attached Double constructor

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Float: Float

Make Float

Make Float

Attached Float constructor

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Int: Int

Make Int

Make Int

Attached Int constructor

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Long: Long

Make Long

Make Long

Attached Long constructor

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Number: java.lang.Short

Make Number

Make Number

Attached Number constructor

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Short: Short

Make Short

Make Short

Returnes underlying value

Inherited from
toPrimitives
Source
toPrimitives.scala