On this page
Trait ScalaNumericConversions.ScalaNumericConversions
trait ScalaNumericConversions extends ScalaNumber with ScalaNumericAnyConversions
A slightly more specific conversion trait for classes which extend ScalaNumber (which excludes value classes.)
Supertypes | |
---|---|
Known subtypes |
Abstract methods
Source
def underlying: Object
Inherited methods
Inherited from | Number |
---|
Source
def doubleValue: Double
Inherited from | ScalaNumericAnyConversions |
---|
Source
def floatValue: Float
Inherited from | ScalaNumericAnyConversions |
---|
Source
Inherited from | ScalaNumericAnyConversions |
---|
Source
def isValidByte: Boolean
Returns true
iff this has a zero fractional part, and is within the range of scala.Byte MinValue and MaxValue; otherwise returns false
.
Inherited from | ScalaNumericAnyConversions |
---|
Source
def isValidChar: Boolean
Returns true
iff this has a zero fractional part, and is within the range of scala.Char MinValue and MaxValue; otherwise returns false
.
Inherited from | ScalaNumericAnyConversions |
---|
Source
def isValidInt: Boolean
Returns true
iff this has a zero fractional part, and is within the range of scala.Int MinValue and MaxValue; otherwise returns false
.
Inherited from | ScalaNumericAnyConversions |
---|
Source
def isValidShort: Boolean
Returns true
iff this has a zero fractional part, and is within the range of scala.Short MinValue and MaxValue; otherwise returns false
.
Inherited from | ScalaNumericAnyConversions |
---|
Source
Returns |
|
---|---|
Inherited from | ScalaNumericAnyConversions |
Source
Inherited from | ScalaNumericAnyConversions |
---|
def shortValue(): Short
Inherited from | Number |
---|
Source
Returns the value of this as a scala.Byte. This may involve rounding or truncation.
Inherited from | ScalaNumericAnyConversions |
---|
Source
Returns the value of this as a scala.Char. This may involve rounding or truncation.
Inherited from | ScalaNumericAnyConversions |
---|
Source
Returns the value of this as a scala.Double. This may involve rounding or truncation.
Inherited from | ScalaNumericAnyConversions |
---|
Source
Returns the value of this as a scala.Float. This may involve rounding or truncation.
Inherited from | ScalaNumericAnyConversions |
---|
Source
Returns the value of this as an scala.Int. This may involve rounding or truncation.
Inherited from | ScalaNumericAnyConversions |
---|
Source
Returns the value of this as a scala.Long. This may involve rounding or truncation.
Inherited from | ScalaNumericAnyConversions |
---|
Source
Returns the value of this as a scala.Short. This may involve rounding or truncation.
Inherited from | ScalaNumericAnyConversions |
---|
Source
Should only be called after all known non-primitive types have been excluded. This method won't dispatch anywhere else after checking against the primitives to avoid infinite recursion between equals and this on unknown "Number" variants.
Additionally, this should only be called if the numeric type is happy to be converted to Long, Float, and Double. If for instance a BigInt much larger than the Long range is sent here, it will claim equality with whatever Long is left in its lower 64 bits. Or a BigDecimal with more precision than Double can hold: same thing. There's no way given the interface available here to prevent this error.
Inherited from | ScalaNumericAnyConversions |
---|
Source
protected def unifiedPrimitiveHashcode: Int
Inherited from | ScalaNumericAnyConversions |
---|
© 2002-2022 EPFL, with contributions from Lightbend.
Licensed under the Apache License, Version 2.0.
https://scala-lang.org/api/3.2.0/scala/math/ScalaNumericConversions.html