baml._sum_int

(internal) Native backing for `int[].sum()`; call that instead. Adds every element left to right starting from `0`, range-checking the running total at each step. The empty array sums to `0`.

Reference version

Signature

function baml._sum_int(values: int[]) -> int throws never

(internal) Native backing for int[].sum(); call that instead. Adds every element left to right starting from 0, range-checking the running total at each step. The empty array sums to 0.

Panics

  • baml.panics.IntegerOverflow when a running total leaves the int range.

Source:<builtin>/baml/containers.bamlbytes 39140–39215