Double

scala.Double
See theDouble companion class
object Double

Attributes

Companion
class
Source
Double.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Double.type

Members list

Value members

Concrete methods

def box(x: Double): Double

Transforms a value type into a boxed reference type.

Transforms a value type into a boxed reference type.

Runtime implementation determined by scala.runtime.BoxesRunTime.boxToDouble. See src/library/scala/runtime/BoxesRunTime.java.

Value parameters

x

the Double to be boxed

Attributes

Returns

a java.lang.Double offering x as its underlying value.

Source
Double.scala
override def toString(): String

The String representation of the scala.Double companion object.

The String representation of the scala.Double companion object.

Attributes

Definition Classes
Any
Source
Double.scala
def unbox(x: Object): Double

Transforms a boxed type into a value type. Note that this method is not typesafe: it accepts any Object, but will throw an exception if the argument is not a java.lang.Double.

Transforms a boxed type into a value type. Note that this method is not typesafe: it accepts any Object, but will throw an exception if the argument is not a java.lang.Double.

Runtime implementation determined by scala.runtime.BoxesRunTime.unboxToDouble. See src/library/scala/runtime/BoxesRunTime.java.

Value parameters

x

the java.lang.Double to be unboxed.

Attributes

Returns

the Double resulting from calling doubleValue() on x

Throws
ClassCastException

if the argument is not a java.lang.Double

Source
Double.scala

Concrete fields

final val MaxValue: 1.7976931348623157E308d

The largest finite positive number representable as a Double.

The largest finite positive number representable as a Double.

Attributes

Source
Double.scala
final val MinPositiveValue: 4.9E-324d

The smallest positive value greater than 0.0d which is representable as a Double.

The smallest positive value greater than 0.0d which is representable as a Double.

Attributes

Source
Double.scala
final val MinValue: -1.7976931348623157E308d

The negative number with the greatest (finite) absolute value which is representable by a Double. Note that it differs from java.lang.Double.MIN_VALUE, which is the smallest positive value representable by a Double. In Scala that number is called Double.MinPositiveValue.

The negative number with the greatest (finite) absolute value which is representable by a Double. Note that it differs from java.lang.Double.MIN_VALUE, which is the smallest positive value representable by a Double. In Scala that number is called Double.MinPositiveValue.

Attributes

Source
Double.scala
final val NaN: NaNd

Attributes

Source
Double.scala
final val NegativeInfinity: -Infinityd

Attributes

Source
Double.scala
final val PositiveInfinity: Infinityd

Attributes

Source
Double.scala

Extensions

Deprecated extensions

extension (self: Double)
def abs: Double

Returns the absolute value of this.

Returns the absolute value of this.

Attributes

Source
Double.scala
def ceil: Double

Returns the smallest integer greater or equal to this.

Returns the smallest integer greater or equal to this.

Attributes

Source
Double.scala
def compare(that: Double): Int

Compares this to that according to the standard total ordering.

Compares this to that according to the standard total ordering.

Returns:

  • a positive value if this > that
  • a negative value if this < that
  • 0 if this == that

Special cases for this method:

  • 0.0 is considered greater than -0.0
  • NaN is considered greater than all other values, but equal to itself

Attributes

Source
Double.scala
def floor: Double

Returns the largest integer smaller or equal to this.

Returns the largest integer smaller or equal to this.

Attributes

Source
Double.scala

Returns true iff this is a finite value, i.e., not an infinity nor NaN.

Returns true iff this is a finite value, i.e., not an infinity nor NaN.

Attributes

Source
Double.scala

Returns true iff this is PositiveInfinity or NegativeInfinity.

Returns true iff this is PositiveInfinity or NegativeInfinity.

Attributes

Source
Double.scala
def isNaN: Boolean

Returns true iff this is a NaN value.

Returns true iff this is a NaN value.

Attributes

Source
Double.scala

Returns true iff this is NegativeInfinity.

Returns true iff this is NegativeInfinity.

Attributes

Source
Double.scala

Returns true iff this is PositiveInfinity.

Returns true iff this is PositiveInfinity.

Attributes

Source
Double.scala

Returns true iff this has a zero fractional part, and is within the range of scala.Byte MinValue and MaxValue; otherwise returns false.

Returns true iff this has a zero fractional part, and is within the range of scala.Byte MinValue and MaxValue; otherwise returns false.

Attributes

Source
Double.scala

Returns true iff this has a zero fractional part, and is within the range of scala.Char MinValue and MaxValue; otherwise returns false.

Returns true iff this has a zero fractional part, and is within the range of scala.Char MinValue and MaxValue; otherwise returns false.

Attributes

Source
Double.scala

Returns true iff this has a zero fractional part, and is within the range of scala.Int MinValue and MaxValue; otherwise returns false.

Returns true iff this has a zero fractional part, and is within the range of scala.Int MinValue and MaxValue; otherwise returns false.

Attributes

Source
Double.scala

Returns true iff this has a zero fractional part, and is within the range of scala.Short MinValue and MaxValue; otherwise returns false.

Returns true iff this has a zero fractional part, and is within the range of scala.Short MinValue and MaxValue; otherwise returns false.

Attributes

Source
Double.scala

Returns '''true''' if this number is finite and has no decimal component.

Returns '''true''' if this number is finite and has no decimal component.

Attributes

Source
Double.scala
def max(that: Double): Double

Returns this if this > that or that otherwise.

Returns this if this > that or that otherwise.

Attributes

Source
Double.scala
def min(that: Double): Double

Returns this if this < that or that otherwise.

Returns this if this < that or that otherwise.

Attributes

Source
Double.scala
def round: Long

Returns the closest Long to this.

Returns the closest Long to this.

Attributes

Source
Double.scala
def sign: Double

Returns the sign of this.

Returns the sign of this.

  • 1.0 if this > 0.0;
  • -1.0 if this < 0.0;
  • this otherwise (for zeros and NaN).

Attributes

Source
Double.scala
def signum: Int

Returns the signum of this.

Returns the signum of this.

Attributes

Deprecated
[Since version 2.13.0] signum does not handle -0.0 or Double.NaN; use `sign` method instead
Source
Double.scala

Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

Attributes

Returns

the measurement of the angle x in degrees.

Source
Double.scala

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

Attributes

Returns

the measurement of the angle x in radians.

Source
Double.scala