Euler

com.phasmidsoftware.number.core.inner.Euler
case object Euler extends Logarithmic

This factor allows the representation of quantities of the form e power ix.

NOTE: A number in factor Euler will evaluate as e raised to (i times that power). So, the value is the natural log of the evaluation.

We call this Euler because it is used in Euler's formula https://en.wikipedia.org/wiki/Euler's_formula. However, let the record state that Roger Cotes, an English mathematician, used this quantity before Euler https://en.wikipedia.org/wiki/Euler's_formula#History.

Thus the range of such values is subject to the same modulation as Radian.

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Logarithmic
trait Factor
class Object
trait Matchable
class Any
Show all
Self type
Euler.type

Members list

Type members

Inherited types

type MirroredElemLabels = EmptyTuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Singleton
type MirroredElemTypes = EmptyTuple

Attributes

Inherited from:
Singleton
type MirroredMonoType = this.type

The mirrored *-type.

The mirrored *-type.

Attributes

Inherited from:
Singleton
type MirroredType = this.type

Attributes

Inherited from:
Singleton

Inherited and Abstract types

type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def isExact: Boolean

Determines whether the current scalar can be exactly converted to a PureNumber.

Determines whether the current scalar can be exactly converted to a PureNumber.

Attributes

Returns

true if the scalar represents an exact value; false otherwise.

override def toString: String

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.

Definition Classes
Any

Inherited methods

def add(x: Value, y: Value, f: Factor, negative: Boolean): Option[ProtoNumber]

Adds two values together and computes an appropriate factor for the result.

Adds two values together and computes an appropriate factor for the result.

Value parameters

f

the factor associated with y

negative

NOTE ignored.

x

the first value

y

the addend

Attributes

Returns

an optional tuple containing the resultant value and its factor

Inherited from:
Logarithmic
def asPower(v: Value): Option[String]

Converts a given value into a string representation of its corresponding power notation or root notation based on specific conditions.

Converts a given value into a string representation of its corresponding power notation or root notation based on specific conditions.

Value parameters

v

the value to be converted, which can represent an integer power or a rational root.

Attributes

Returns

a string representing the value in power notation, root notation, or a generic exponential format.

Inherited from:
Logarithmic
def canAdd(f: Factor): Boolean

Determines whether the current factor can be augmented by the given factor. CONSIDER do we need this method now that we have add(x, y, this)?

Determines whether the current factor can be augmented by the given factor. CONSIDER do we need this method now that we have add(x, y, this)?

Value parameters

f

the factor to be checked for compatibility with addition.

Attributes

Returns

true if the factors can be added; false otherwise.

Inherited from:
Factor
def canMultiply(f: Factor): Boolean

Determines whether the current factor can be multiplied by the given factor.

Determines whether the current factor can be multiplied by the given factor.

TODO implement me properly

Value parameters

f

the factor to be checked for compatibility with multiplication.

Attributes

Returns

true if the factors can be multiplied; false otherwise.

Inherited from:
Logarithmic
def canRaise(f: Factor, exponent: Field): Boolean

Determines whether this factor can be raised by the given factor f. CONSIDER do we need this method now that we have raise(x, y, this)?

Determines whether this factor can be raised by the given factor f. CONSIDER do we need this method now that we have raise(x, y, this)?

Value parameters

f

the factor to be checked for compatibility with raising to a power.

Attributes

Returns

true if the factors can be powered; false otherwise.

Inherited from:
Factor
def canShow(value: Value): Boolean

Determines whether given value with this Factor can be rendered exactly.

Determines whether given value with this Factor can be rendered exactly.

Attributes

Returns

true if this Factor can be rendered exactly; false otherwise.

Inherited from:
Logarithmic
def clean(po: Option[ProtoNumber]): Option[ProtoNumber]

Cleans a given optional ProtoNumber by potentially simplifying its root quantities based on specific conditions and returning the modified result.

Cleans a given optional ProtoNumber by potentially simplifying its root quantities based on specific conditions and returning the modified result.

Value parameters

po

an optional ProtoNumber that may be simplified

Attributes

Returns

an optional ProtoNumber, simplified if applicable, or None if input is None

Inherited from:
Factor
def convert(v: Value, f: Factor): Option[Value]

Convert a value x from this factor to f if possible, using simple scaling. Result is defined only if f is Logarithmic.

Convert a value x from this factor to f if possible, using simple scaling. Result is defined only if f is Logarithmic.

Value parameters

f

the factor of the result.

v

the value to be converted.

Attributes

Returns

a Try of Value which, given factor f, represents the same quantity as x given this.

Inherited from:
Logarithmic

Raises the value x to the power of the value y.

Raises the value x to the power of the value y.

Value parameters

x

the base value to be raised

y

the exponent value (from a PureNumber)

Attributes

Returns

an optional result of type ProtoNumber, representing the computed value if the operation is valid, or None otherwise

Inherited from:
Logarithmic
def fromProduct(p: Product): MirroredMonoType

Creates a new instance of type T with elements taken from product p.

Creates a new instance of type T with elements taken from product p.

Attributes

Inherited from:
Singleton
def invert(x: Value): Option[ProtoNumber]

Inverts the given value by raising it to the power of -1, using a pure number factor.

Inverts the given value by raising it to the power of -1, using a pure number factor.

Value parameters

x

the value to be inverted

Attributes

Returns

an optional result of type ProtoNumber, representing the inverted value if the operation is valid, or None otherwise

Inherited from:
Logarithmic
def isA(context: CoreContext): Boolean

Determines if the current factor satisfies certain conditions within the given context.

Determines if the current factor satisfies certain conditions within the given context.

Value parameters

context

the context in which the factor is evaluated.

Attributes

Returns

a Boolean indicating whether the factor satisfies the specified conditions in the given context.

Inherited from:
Logarithmic
def modulate(v: Value): Value

Modulates a given value and returns the result.

Modulates a given value and returns the result.

Value parameters

v

the value to be modulated

Attributes

Returns

the original value

Inherited from:
Logarithmic
def multiply(x: Value, y: Value, f: Factor): Option[ProtoNumber]

Multiplies two values together and computes an appropriate factor for the result. TODO implement for Log10

Multiplies two values together and computes an appropriate factor for the result. TODO implement for Log10

Value parameters

f

the factor associated with y

x

the first value

y

the multiplicand

Attributes

Returns

an optional tuple containing the resultant value and its factor

Inherited from:
Logarithmic
def negate(x: Value): Option[ProtoNumber]

Negates the given value and returns the result as an optional ProtoNumber.

Negates the given value and returns the result as an optional ProtoNumber.

Value parameters

x

the value to be negated

Attributes

Returns

an optional ProtoNumber representing the negated value, or None if the operation is invalid

Inherited from:
Logarithmic
def productElementNames: Iterator[String]

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
def productIterator: Iterator[Any]

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
def raise(x: Value, y: Value, f: Factor): Option[ProtoNumber]

Raises x to the power of y and compute an appropriate factor for the result. NOTE: for now, we only allow raising to a power of a PureNumber. TODO: enable powers of Radian factor.

Raises x to the power of y and compute an appropriate factor for the result. NOTE: for now, we only allow raising to a power of a PureNumber. TODO: enable powers of Radian factor.

Value parameters

f

the factor associated with y

x

the first value

y

the power

Attributes

Returns

an optional tuple containing the resultant value and its factor

Inherited from:
Factor
def render(v: String): String

Renders a string representation of the value based on the current base and the given input value. CONSIDER why do we have a second signature for render?

Renders a string representation of the value based on the current base and the given input value. CONSIDER why do we have a second signature for render?

Value parameters

v

the input value to be rendered, represented as a string

Attributes

Returns

a string combining the base and the input value in a specific exponential format

Inherited from:
Logarithmic
override def render(x: Value): String

Renders a string representation of the given value based on specific conditions. If the value can be represented in power or root notation, it uses that representation; otherwise, it falls back to the string representation of the value.

Renders a string representation of the given value based on specific conditions. If the value can be represented in power or root notation, it uses that representation; otherwise, it falls back to the string representation of the value.

Value parameters

x

the value to be rendered into a string representation.

Attributes

Returns

a string representation of the value, using power or root notation when applicable.

Definition Classes
Inherited from:
Logarithmic

Concrete fields

val base: String

Represents the base symbol used for the NatLog factor.

Represents the base symbol used for the NatLog factor.

The symbol is defined as the mathematical constant ℯ to the power i. This constant is used to indicate the base of the imaginary natural logarithm and is sourced from the Factor object.

Attributes

val value: Double

Represents the default value for the Euler factor. Should not be used.

Represents the default value for the Euler factor. Should not be used.

Attributes

Inherited fields

lazy val isAdditive: Boolean

Determines if the current factor operates additively.

Determines if the current factor operates additively.

Attributes

Returns

false.

Inherited from:
Logarithmic