JavaScript / TypeScript API

nerdamer/core

Expressions, equations, numeric values, conversion helpers, errors, and other core building blocks.

Direct npm import. The items on this page are JavaScript / TypeScript exports from nerdamer/core. For functions used inside nerdamer('...'), see Nerdamer Notation.
35 exports

Function

Classes

AssignmentErrorClass

Thrown when code attempts to assign to a reserved or otherwise non-assignable parser name.

CoeffObjectClass

Stores coefficients indexed by the power or multidegree collected from an expression.

ConverterClass

Formats Nerdamer values as TeX or normalized text and imports supported TeX input.

DimensionErrorClass

Thrown when vector, matrix, or structured-entity dimensions are incompatible.

DivisionByZeroErrorClass

Thrown for exact division by zero. Small nonzero numerical values are not treated as zero.

EquationClass

Represents a symbolic equality between two expression sides.

ExpressionClass

Represents a symbolic expression in Nerdamer's canonical expression tree.

MathErrorClass

General mathematical precondition error for cases without a more specific error type.

MissingReferenceErrorClass

Thrown when a named converter or pattern reference cannot be resolved.

NaNErrorClass

Thrown when a required numeric conversion produces NaN.

NotImplementedErrorClass

Used for recognized operations that have not been implemented yet.

OperatorErrorClass

Used for invalid parser-operator definitions and operator dispatch failures.

ParserErrorClass

General parser error for construction, evaluation, and registered-function failures.

ParserSyntaxErrorClass

Parser syntax error kept separate from lower-level tokenization failures.

PolynomialErrorClass

Thrown when input cannot be represented as a polynomial under the requested requirements.

RationalClass

Represents an exact rational value as a bigint numerator and denominator.

UndefinedErrorClass

Used when a mathematical operation has no defined value in the handled domain.

UnexpectedDataTypeClass

Thrown when an operation receives a Nerdamer entity of the wrong runtime type.

UnexpectedInputErrorClass

Used when input parses successfully but does not have the form an operation requires.

UnexpectedTokenErrorClass

Thrown when tokenization encounters invalid adjacency, punctuation, or bracket structure.

UnsupportedOperationErrorClass

Thrown when an operation is known but unsupported for the supplied form or domain.

ZeroToZeroPowerErrorClass

Thrown for the indeterminate symbolic form 0^0.

Interface

Type

Variable

APIs

ElementsSortType(a: Expression, b: Expression): numberAPI

API exported by Nerdamer.

ExpressionInput: number | string | Rational | Expression | bigint | DecimalAPI

Values accepted by Nerdamer's expression-oriented parsing APIs.

JsFunction(...args: number[]): number | booleanAPI

Native JavaScript function produced or consumed by numerical compilation APIs. Arguments and numeric results use JavaScript number arithmetic rather than Nerdamer's exact rational or arbitrary-precision symbolic representation. Boolean results support compiled comparison expressions.

NerdamerInput: ExpressionInput | Vector | ValuesSet | Collection | Matrix | Dictionary | EquationAPI

Values accepted across Nerdamer's root API and direct object model. This extends ExpressionInput with the structured parser entities and equations that can be passed back into supported operations. Individual functions may accept a narrower subset and should document that restriction locally.

OptionValue: string | boolean | number | string[] | OptionsObjectAPI

Values currently accepted by Nerdamer's broad settings objects.

ParserConstants: Record<string, (): string | string>API

Constant definitions accepted by the parser's constant registry. String definitions are parsed when the constant is encountered. Function definitions are deferred factories that return parser text, allowing constants such as pi and e to reflect the active numerical precision. The registry itself is process-wide; this type does not imply isolated parser state.

ParserEntity: Expression | Vector | ValuesSet | Collection | Matrix | Equation | DictionaryAPI

Values that can be produced by Nerdamer's parser.

ParserValuesObject: Record<string, NerdamerInput>API

Named values substituted while parsing or evaluating an input expression. Keys are parser variable names. This compatibility type accepts the same broad value union as the root API, but not every substitution path can consume every structured entity. The receiving operation's documentation defines the narrower requirements when one applies.

StructuredEntityType: Matrix | Vector | Collection | DictionaryAPI

Structured parser entities that participate in aggregate operations. The union describes Nerdamer's supported matrix, vector, ordered collection, and keyed dictionary containers. It excludes value sets and equations, whose semantics are not ordinary elementwise structured operations.