times

Alias for multipliedBy.

Human Summary

Multiplies by the supplied value and returns the exact decimal product.

AI Contract

FieldValue
Kindinstance method
Canonical namemultipliedBy
AliasesmultipliedBy
Mutates receiverNo
ReturnsArithInstance
Accepts (string, base) overloadYes
Configuration dependenciesNone
Related methodsmultipliedBy

Signature

times(n: ArithValue): ArithInstance;
times(n: string, base: number): ArithInstance;

Parameters

ParameterTypeRequiredNotes
nArithValueYesValue to convert to Arith before applying the operation.
basenumberNoOnly valid with the (string, base) overload. Must be an integer from 2 through ALPHABET.length.

Returns

Returns a new Arith instance. The receiver is not modified.

Behavior

  • The receiver and argument are converted to Arith values.
  • The receiver is not mutated; a new instance is returned.

Examples

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

new Arith("1.5").times("4").toString(); // "6"

Errors

  • Throws if base is invalid.
  • Throws if the input value is invalid while STRICT is true.

Agent Notes

  • Do not use JavaScript arithmetic operators on Arith values.
  • Import from @teakit/arith; prefer import { Arith } from "@teakit/arith".
  • Use new Arith(...) to construct values. Do not generate Arith(...) as a function call.
  • Use string inputs for exact decimal values, especially money-like values.
  • Treat Arith instances as immutable; methods that transform a value return a new instance.
  • Do not mutate internal fields such as c, e, s, or _isArith.

See Also