baml._median_float

(internal) Native backing for `float[].median()`; call that instead. Sorts a *copy* of `values` by BAML's total float order and returns the middle element, or the mean of the two middle elements for an even count, leaving `values` untouched.

Reference version

Signature

function baml._median_float(values: float[]) -> float throws baml.errors.InvalidArgument

(internal) Native backing for float[].median(); call that instead. Sorts a copy of values by BAML's total float order and returns the middle element, or the mean of the two middle elements for an even count, leaving values untouched.

Throws

  • baml.errors.InvalidArgument when values is empty.

Source:<builtin>/baml/containers.bamlbytes 39907–40013