Sub-class of Field: as opposed to Complex.
TODO remove (direct) Number references and replace with Real.
Value parameters
- x
-
a Number which represents the value of this Real.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Fieldtrait Ordered[Field]trait Comparable[Field]trait Approximatabletrait Numericaltrait NumberLikeclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object NaN
Members list
Value members
Concrete methods
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.
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
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
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.
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
-
Equals -> Any
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.
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.
Attributes
- Returns
-
an integer hash code value for the object
- Definition Classes
-
Any
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.
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.
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
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.
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 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
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
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
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
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
Concrete 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.
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.
Method to return the x of this Real.
Method to return the x of this Real.
Attributes
- Returns
-
Some(x).
Method to return this Real as an Option[Real]..
Method to return this Real as an Option[Real]..
Attributes
- Returns
-
Some(this).
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.
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.
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
Attributes
- Returns
-
false.
Attributes
- Returns
-
false.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Method to "normalize" a field.
Method to "normalize" a field.
Attributes
- Returns
-
a Real which is in canonical form.
Method to render this Field in a presentable manner.
Method to render this Field in a presentable manner.
Attributes
- Returns
-
a String
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
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.
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.
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.
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.
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
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.
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.