Prelude API
    Preparing search index...

    Function magnitude

    • Parameters

      • values: readonly number[]

      Returns number

      cartesian distance from origin.

      Components are divided by the largest absolute component before squaring, so vectors of very small (e.g. 1e-200) or very large (e.g. 1e200) components neither underflow to 0 nor overflow to Infinity the way a plain sum of squares would.