_methods

trait _methods

Float Extension Methods

Extension methods universaly avaialble for type scala.Float

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

Def

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

Range

Range

Returns Float.<> from current to given value

 (1F <> 10F).tp  // Prints  1.0 <> 10.0
Source
_methods.scala
@scala.annotation.targetName("rangeX")
inline def <>>(inline to: Float): Float.<>

Exclusive end range

Exclusive end range

Returns Float.<> from current to given value exclusive

 (1F <>> 10F).tp  // Prints  1.0 <>> 10.0
Source
_methods.scala
@scala.annotation.targetName("Opt")
inline def ?: Float.Opt

To option

To option

Returns Float.Opt for current value

 val o : Float.Opt = 12F.?
Source
_methods.scala
inline def atLeast(v: Float): Float

Max

Max

Returns maximum of current or given value

 val v = 5F

 v.atLeast(0).tp   // Prints 5.0

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

Min

Min

Returns minimun of current or given value

 val v = 5F

 v.atMost(0).tp   // Prints 0.0

 v.atMost(10).tp  // Prints 5.0
Source
_methods.scala
inline def roundDecimal(inline d: Int)(using inline r: Rounding): Float
inline def roundTo(inline size: Float)(using inline r: Rounding): Float

Round to size

Round to size

Rounds current value to specified size

 91F.roundTo(5).tp            // Prints 90.0

 91F.roundTo(5)(using UP).tp  // Prints 95.0
Source
_methods.scala

Make

inline def Big: BigDecimal

Make BigDecimal

Make BigDecimal

BigDecimal constructor attached to Float

Source
_methods.scala
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 Day: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Days: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.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

Returnes underlying value

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Hour: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Hours: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.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 Micros: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Millis: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Minute: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Minutes: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Nanos: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Number: java.lang.Float

Make Number

Make Number

Attached Number constructor

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

Make Percent

Make Percent

Percent constructor attached to Float

Source
_methods.scala
inline def Second: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Seconds: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Short: Short

Make Short

Make Short

Attached Short constructor

Inherited from
toPrimitives
Source
toPrimitives.scala
inline def Week: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala
inline def Weeks: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Float

Source
_methods.scala