cumulativeMul

Returns one running multiplication result per input value.

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

Arith.cumulativeMul(["1", "2", "3"]).map((x) => x.toString()); // ["1", "2", "6"]
Arith.cumulativeMul(["1.1", "1.2", "0.9"]).map((x) => x.toString()); // ["1.1", "1.32", "1.188"]
Arith.cumulativeMul([]); // []

API Reference

Signature

Arith.cumulativeMul(values: readonly ArithValue[]): ArithInstance[];

Parameters

ParameterTypeRequiredNotes
valuesreadonly ArithValue[]YesArray of finite values. Empty arrays are allowed.

Returns

Returns an ArithInstance[] with the same length as values.

Throws

  • Throws if values is not an array.
  • Throws if any value is non-finite.

Agent Contract

FieldValue
Kindstatic method
Canonical namecumulativeMul
AliasesNone
Mutates receiverNo
ReturnsArithInstance[]
Accepts (string, base) overloadNo
Configuration dependenciesSTRICT
Related methodsmul, cumulativeSum

Agent Notes

  • Empty input returns [].
  • Use this for compounded factors, cumulative growth series, or other step-by-step multiplication results.