_methods

trait _methods

Double Extension Methods

Extension methods universaly avaialble for type scala.Double

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

Def

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

Range

Range

Returns Double.Range from current to given value

 (1.0 <> 10.0).tp  // Prints  1.0 <> 10.0
Source
_methods.scala
@targetName("rangeX")
inline def <>>(to: Double): Double.Range

Exclusive end range

Exclusive end range

Returns Double.Range from current to given value exclusive

 (1.0 <>> 10.0).tp  // Prints  1.0 <>> 10.0
Source
_methods.scala
@targetName("Opt")
inline def ?: Double.Opt

To option

To option

Returns Double.Opt for current value

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

Max value

Max value

Returns maximum of current or given value

 val v = 5F

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

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

Min value

Min value

Returns minimun of current or given value

 val v = 5F

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

 v.min(10).tp  // Prints 5.0
Source
_methods.scala
inline def roundTo(unit: Double)(using r: Math.Rounding): Double

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
inline def roundToDecimal(d: Int)(using r: Math.Rounding): Double

Round to decimal

Round to decimal

Rounds current value to specified decimal position of fractional value

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

Returns underlying value

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

Make Number

Make Number

Attached Number constructor

Source
_methods.scala
inline def toShort: Short

Make Short

Make Short

Attached Short constructor

Source
_methods.scala

Make

inline def Big: BigDecimal

Make BigDecimal

Make BigDecimal

BigDecimal constructor attached to Double

Source
_methods.scala
inline def Day: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Days: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Hour: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Hours: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Micros: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Millis: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Minute: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Minutes: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Nanos: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Percent: Percent

Make Percent

Make Percent

Percent constructor attached to Double

Source
_methods.scala
inline def Second: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Seconds: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Week: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala
inline def Weeks: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Double

Source
_methods.scala