NaN
Represents a constant Real number corresponding to "Not a Number" (NaN).
This object is a specialized instance of Real, serving as a marker for undefined or unrepresentable numerical values within the Real number context.
Inherits all behavior and operations defined by the Real class, but specific methods and operations involving NaN may yield NaN or other behavior consistent with the IEEE 754 standard for floating-point arithmetic.
Attributes
- Graph
-
- Supertypes
-
class Realtrait Serializabletrait Producttrait Equalstrait Fieldtrait Ordered[Field]trait Comparable[Field]trait Approximatabletrait Numericaltrait NumberLikeclass Objecttrait Matchableclass AnyShow all
- Self type
-
NaN.type
Members list
Value members
Inherited methods
Multiply this Field by the given Field and return the result.
Multiply this Field by the given Field and return the result.
Value parameters
- x
-
the multiplicand, an instance of Field.
Attributes
- Returns
-
the product of this Field and the given Field.
- Inherited from:
- Field
Synonym for add.
Synonym for add.
Value parameters
- x
-
the addend.
Attributes
- Returns
-
the result.
- Inherited from:
- Field
Synonym for subtract.
Synonym for subtract.
Value parameters
- x
-
the subtrahend.
Attributes
- Returns
-
this - x. - Inherited from:
- Field
Returns true if this is less than that
Returns true if this is less than that
Value parameters
- that
-
the instance to compare against
Attributes
- Inherited from:
- Ordered
Returns true if this is less than or equal to that.
Returns true if this is less than or equal to that.
Attributes
- Inherited from:
- Ordered
Returns true if this is greater than that.
Returns true if this is greater than that.
Value parameters
- that
-
the instance to compare against
Attributes
- Inherited from:
- Ordered
Returns true if this is greater than or equal to that.
Returns true if this is greater than or equal to that.
Attributes
- Inherited from:
- Ordered
Add y to this Real and return the result. See Number.plus for more detail.
Add y to this Real and return the result. See Number.plus for more detail.
Value parameters
- y
-
the addend.
Attributes
- Returns
-
the sum.
- Inherited from:
- Real
Computes an approximation of the field as a real number, if possible. This method attempts to map the underlying numerical representation to a real value.
Computes an approximation of the field as a real number, if possible. This method attempts to map the underlying numerical representation to a real value.
Attributes
- Returns
-
an Option containing the Real representation of this field if it can be approximated, or None if the approximation is not possible.
- Inherited from:
- Field
Converts this NumberLike object into an optional java.lang.Number provided that the conversion can be performed without loss of precision.
Converts this NumberLike object into an optional java.lang.Number provided that the conversion can be performed without loss of precision.
The method determines whether the current NumberLike object can be represented as a java.lang.Number by leveraging the asNumber method and further evaluating certain conditions:
- If the
NumberLikeobject is anExactNumberand its factor isPureNumber, the result is converted usingValue.asJavaNumber. - If the
NumberLikeobject is aFuzzyNumberwith awigglevalue below a specified tolerance, the result is also converted usingValue.asJavaNumber. - In all other cases,
Noneis returned.
Attributes
- Returns
-
an optional
java.lang.Numberrepresentation of this object. The result isSome(java.lang.Number)if the conversion is successful under the stated conditions; otherwise,None. - Inherited from:
- NumberLike
Calculate the angle whose opposite length is y and whose adjacent length is this.
Calculate the angle whose opposite length is y and whose adjacent length is this.
Value parameters
- y
-
the opposite length
Attributes
- Returns
-
the angle defined by x = this, y = y
- Inherited from:
- Real
Result of comparing this with operand that.
Result of comparing this with operand that.
Implement this method to determine how instances of A will be sorted.
Returns x where:
-
x < 0whenthis < that -
x == 0whenthis == that -
x > 0whenthis > that
Value parameters
- that
-
the instance to compare against
Attributes
- Returns
-
an integer whose sign indicates the ordering relation between
thisandthat - Inherited from:
- Real
Result of comparing this with operand that.
Result of comparing this with operand that.
Value parameters
- that
-
the instance to compare against
Attributes
- Inherited from:
- Ordered
Divide this Real by y and return the result.
Divide this Real by y and return the result.
Value parameters
- y
-
the divisor.
Attributes
- Returns
-
the quotient.
- Inherited from:
- Real
Compares the current object with the specified object for equality.
Compares the current object with the specified object for equality.
CONSIDER eliminating this method as it is simply the default implementation.
Value parameters
- obj
-
the object to compare with the current object
Attributes
- Returns
-
true if the specified object is of type
Realand its value matches the current object's value, false otherwise - Definition Classes
- Inherited from:
- Real
Computes a hash code value for the object. This method is intended to provide a consistent hash code implementation based on the hashCode of the encapsulated value or component.
Determines if the current instance is approximately equal to zero with at least the specified confidence level.
Determines if the current instance is approximately equal to zero with at least the specified confidence level.
Value parameters
- confidence
-
the confidence level, typically between 0 and 1. Ignored if the instance is definitively zero.
Attributes
- Returns
-
true if the instance is considered approximately zero with the given confidence, false otherwise.
- Inherited from:
- Real
Method to determine if this Field is equivalent to another Field (x).
Method to determine if this Field is equivalent to another Field (x).
Value parameters
- f
-
the other field.
Attributes
- Returns
-
true if they are the same, otherwise false.
- Inherited from:
- Real
Method to determine if this NumberLike object is a member of the given set.
Method to determine if this NumberLike object is a member of the given set.
Value parameters
- set
-
the candidate NumberSet.
Attributes
- Returns
-
true if this is exact and belongs to set.
- Inherited from:
- NumberLike
Method to determine the NumberSet, if any, to which this NumberLike object belongs. NOTE that we don't yet support H, the quaternions.
Method to determine the NumberSet, if any, to which this NumberLike object belongs. NOTE that we don't yet support H, the quaternions.
Attributes
- Returns
-
Some(numberSet) or None if it doesn't belong to any (for example, it is fuzzy).
- Inherited from:
- NumberLike
Multiply this Real by y and return the result.
Multiply this Real by y and return the result.
- @param y the multiplicand.
- @return the product.
Attributes
- Inherited from:
- Real
Raise this Real to the power p.
Raise this Real to the power p.
If the Number of this Real is exact and if the exponent p is rational, then we convert x to a ComplexPolar first and raise that to power p.
Value parameters
- p
-
a Field.
Attributes
- Returns
-
this Real raised to power p.
- Inherited from:
- Real
Raise this Real to the power p where p is a Number.
Raise this Real to the power p where p is a Number.
If the Number of this Real is exact and if the exponent p is rational, then we convert x to a ComplexPolar first and raise that to power p.
Value parameters
- p
-
a Number.
Attributes
- Returns
-
this Real raised to power p.
- Inherited from:
- Real
Raise this Field to the power p.
Raise this Field to the power p.
Value parameters
- p
-
an Int.
Attributes
- Returns
-
this Field raised to power p.
- Inherited from:
- Field
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Subtract x from this Field and return the result.
Subtract x from this Field and return the result.
Value parameters
- x
-
the subtrahend.
Attributes
- Returns
-
the difference of this - x.
- Inherited from:
- Field
Converts this Field instance to its equivalent rational representation if it is real-valued.
Converts this Field instance to its equivalent rational representation if it is real-valued.
Attributes
- Returns
-
an Option containing the rational representation of this Field if it is real-valued; otherwise, None.
- Inherited from:
- Field
Inherited fields
Returns the absolute value of this Real.
Returns the absolute value of this Real.
Attributes
- Returns
-
a Real representing the absolute value of this.
- Inherited from:
- Real
Method to return this Real as a Complex. If this is a Real number x, return ComplexPolar(x) otherwise, return this.
Method to return this Real as a Complex. If this is a Real number x, return ComplexPolar(x) otherwise, return this.
Attributes
- Returns
-
a Complex.
- Inherited from:
- Real
Method to return the x of this Real.
Method to return this Real as an Option[Real]..
Method to determine the cosine of this Real. The result will be a Real with PureNumber factor.
Method to determine the cosine of this Real. The result will be a Real with PureNumber factor.
Attributes
- Returns
-
the cosine.
- Inherited from:
- Real
Method to raise e to the power of this Real. The result will be a Real with NatLog factor.
Method to raise e to the power of this Real. The result will be a Real with NatLog factor.
Attributes
- Returns
-
the e to the power of this.
- Inherited from:
- Real
Yields the inverse of this Real. This Number is first normalized so that its factor is PureNumber, since we cannot directly invert Numbers with other factors.
Yields the inverse of this Real. This Number is first normalized so that its factor is PureNumber, since we cannot directly invert Numbers with other factors.
Attributes
- Inherited from:
- Real
Attributes
- Returns
-
false.
- Inherited from:
- Real
Method to determine if this NumberLike object is exact. For instance, Number.pi is exact, although if you converted it into a PureNumber, it would no longer be exact.
Method to determine if this NumberLike object is exact. For instance, Number.pi is exact, although if you converted it into a PureNumber, it would no longer be exact.
Attributes
- Returns
-
true if this NumberLike object is exact in the context of No factor, else false.
- Inherited from:
- Real
Method to determine if this Field is imaginary-valued (i.e. the point lies on the imaginary axis).
Method to determine if this Field is imaginary-valued (i.e. the point lies on the imaginary axis).
Attributes
- Returns
-
true if this is a root of a negative number.
- Inherited from:
- Real
Method to determine if this Real has infinite magnitude.
Method to determine if this Real has infinite magnitude.
Attributes
- Returns
-
true if the magnitude of this Field is infinite.
- Inherited from:
- Real
Method to determine if this Complex is real-valued.
Method to determine if this Complex is real-valued.
Attributes
- Returns
-
true if this is not imaginary.
- Inherited from:
- Real
Method to determine if this Real has unity magnitude. Unity is the multiplicative identity.
Method to determine if this Real has unity magnitude. Unity is the multiplicative identity.
Attributes
- Returns
-
true if the magnitude of this Field is one.
- Inherited from:
- Real
Method to determine if this Real has zero magnitude. Zero is the additive identity.
Method to determine if this Real has zero magnitude. Zero is the additive identity.
Attributes
- Returns
-
true if the magnitude of this Field is zero.
- Inherited from:
- Real
Method to determine the natural log of this Real. The result will be a Real with PureNumber factor.
Method to determine the natural log of this Real. The result will be a Real with PureNumber factor.
Attributes
- Returns
-
the natural log of this.
- Inherited from:
- Real
Converts the true value of this Real to a Double. If the conversion is unsuccessful, it throws a CoreException.
Converts the true value of this Real to a Double. If the conversion is unsuccessful, it throws a CoreException.
Attributes
- Returns
-
the Double representation of this Real, wrapped in Option.
- Inherited from:
- Real
Method to determine what Factor, if there is such, this NumberLike object is based on.
Method to determine what Factor, if there is such, this NumberLike object is based on.
Attributes
- Returns
-
an optional
Factor. - Inherited from:
- Real
Method to "normalize" a field.
Method to "normalize" a field.
Attributes
- Returns
-
a Real which is in canonical form.
- Inherited from:
- Real
Method to render this Field in a presentable manner.
Method to render this Field in a presentable manner.
Attributes
- Returns
-
a String
- Inherited from:
- Real
Show this Real in a human-friendly manner, delegating to the underlying Number.
Show this Real in a human-friendly manner, delegating to the underlying Number.
Attributes
- Returns
-
a String
- Inherited from:
- Real
Method to determine the sense of this Real: negative, zero, or positive.
Method to determine the sense of this Real: negative, zero, or positive.
Attributes
- Returns
-
an Int which is negative, zero, or positive according to the magnitude of this.
- Inherited from:
- Real
Method to determine the sine of this Real. The result will be a Real with PureNumber factor.
Method to determine the sine of this Real. The result will be a Real with PureNumber factor.
Attributes
- Returns
-
the sine of this.
- Inherited from:
- Real
Computes the square root of this Real number. This is equivalent to raising the number to the power of 1/2.
Computes the square root of this Real number. This is equivalent to raising the number to the power of 1/2.
Attributes
- Returns
-
the square root as a Field.
- Inherited from:
- Real
Squares this Field instance by multiplying it with itself.
Squares this Field instance by multiplying it with itself.
Attributes
- Returns
-
the result of squaring this Field.
- Inherited from:
- Real
Method to determine the tangent of this Real. The result will be a Real with PureNumber factor.
Method to determine the tangent of this Real. The result will be a Real with PureNumber factor.
Attributes
- Returns
-
the tangent
- Inherited from:
- Real
Converts the true value of this Real to a Double. If the conversion is unsuccessful, it throws a CoreException.
Converts the true value of this Real to a Double. If the conversion is unsuccessful, it throws a CoreException.
Attributes
- Returns
-
the Double representation of this Real.
- Inherited from:
- Real