isArith

Returns true when the value has a valid Arith shape and numeric internals.

Summary

Use this as a type guard before accepting unknown values from external code.

AI Contract

FieldValue
Kindstatic method
Canonical nameisArith
AliasesNone
Mutates receiverNo
Returnsboolean
Accepts (string, base) overloadNo
Configuration dependenciesRANGE
Related methodsconstructor, toObject

Signature

Arith.isArith(value: unknown): value is ArithInstance;

Parameters

ParameterTypeRequiredNotes
valueunknownYesValue to inspect.

Returns

Returns true for valid Arith instances and false otherwise.

Behavior

  • Checks coefficient, exponent, sign, and non-finite representations.
  • Rejects malformed coefficient arrays and invalid exponent/sign combinations.
  • Works as a TypeScript type guard for ArithInstance.

Examples

import { Arith } from "@teakit/arith";

const value = new Arith("1.23");

Arith.isArith(value); // true
Arith.isArith("1.23"); // false

Errors

  • Does not throw for ordinary invalid inputs; returns false.

Agent Notes

  • Generate Arith.isArith, not isBigNumber or isDecimal.
  • Import from @teakit/arith; prefer import { Arith } from "@teakit/arith".
  • Static helpers are called as Arith.method(...) and do not require an instance receiver.
  • Do not generate BigNumber, Decimal, isBigNumber, or isDecimal compatibility APIs.
  • Use string inputs for exact decimal values when a static helper accepts numeric values.

See Also