An object that provides a mechanism to map input strings to specific factors such as Radian, NatLog, or PureNumber. It acts as a factory for creating instances of the Factor sealed trait.
The object includes predefined constants representing symbols or keywords associated with certain factors. These constants include mathematical symbols like 'ℯ' and 'π', as well as their textual alternatives.
The apply method takes a string input and matches it to one of the predefined constants to return an appropriate Factor instance.
Matching logic:
- Strings representing π (like "π", "pi", "Radian", "PI") will return the
Radianfactor. - The symbol 'ℯ' will return the
NatLogfactor. - All other strings default to the
PureNumberfactor.
Attributes
Members list
Value members
Concrete methods
Applies the given string to derive a corresponding Factor instance.
Applies the given string to derive a corresponding Factor instance.
The method matches the input string against predefined constants representing specific factors. Depending on the match, it returns an instance of either Radian, NatLog, or PureNumber.
Value parameters
- w
-
the input string to match, which can represent a mathematical symbol or name. Supported values: - Strings representing π (e.g.,
sPi,sPiAlt0,sPiAlt1,sPiAlt2) - String representing ℯ (sE) - Any other string is treated as a pure number.
Attributes
- Returns
-
a
Factorrepresenting the input: -Radianif the input matches a π-related symbol. -NatLogif the input matches the ℯ symbol. -PureNumberotherwise.
Composes two Value instances using the specified dyadic operation. Evaluate a dyadic operator on this and other, using the various functions passed in. NOTE: this and other must have been aligned by type so that they have the same structure. This method is similar to its namesake in GeneralNumber (which, is soon going to be deprecated).
Composes two Value instances using the specified dyadic operation. Evaluate a dyadic operator on this and other, using the various functions passed in. NOTE: this and other must have been aligned by type so that they have the same structure. This method is similar to its namesake in GeneralNumber (which, is soon going to be deprecated).
This method internally uses the Operations.doComposeValueDyadic function, which evaluates the given dyadic operation on the provided values, based on the associated conversion functions.
Value parameters
- op
-
the dyadic operation to be performed, containing the conversion functions.
- x
-
the first operand, a
Value. - y
-
the second operand, a
Value.
Attributes
- Returns
-
an optional
Valuerepresenting the result of the dyadic operation, orNoneif the operation fails.
Concrete fields
Represents the degree symbol ("°") used to denote angular measurement.
Represents the degree symbol ("°") used to denote angular measurement.
Attributes
Represents the Unicode character ℯ (𝜀), which is commonly used to denote Euler's number in mathematics.
Represents the Unicode character ℯ (𝜀), which is commonly used to denote Euler's number in mathematics.
Attributes
Represents the Unicode sequence for the mathematical constant ℯ combined with a modifier character.
Represents the Unicode sequence for the mathematical constant ℯ combined with a modifier character.
The value is a combination of:
- The Unicode character for ℯ (U+1D700)
- A modifier character (U+02E3)
Attributes
Represents the percent symbol (%) as a constant string.
Represents the percent symbol (%) as a constant string.
This field is used within the Factor class to identify specific behavior or matching criteria, potentially related to percentages or division operations.
Attributes
Represents the symbol for π (pi) in Unicode format. This constant can be used to identify and match the mathematical symbol π within the Factor class operations and logic.
Represents the symbol for π (pi) in Unicode format. This constant can be used to identify and match the mathematical symbol π within the Factor class operations and logic.
Attributes
Alternate representation of the mathematical constant π as a string. Used as one of the predefined constants within the Factor class for identifying and handling π-related symbols.
Alternate representation of the mathematical constant π as a string. Used as one of the predefined constants within the Factor class for identifying and handling π-related symbols.
Attributes
Represents an alternative designation for the mathematical constant π (pi) in radians.
Represents an alternative designation for the mathematical constant π (pi) in radians.
This string serves as a predefined constant within the Factor class, used for matching and identifying inputs associated with the radian unit when applying the Factor class's methods.
Attributes
Represents an alternative string representation for the mathematical constant π (Pi). This value is one of several predefined symbols within the Factor class that correspond to π-related constants.
Represents an alternative string representation for the mathematical constant π (Pi). This value is one of several predefined symbols within the Factor class that correspond to π-related constants.