Closed js-choi closed 2 years ago
Closing. hypot
has now been completely removed due to lack of use cases.
See https://github.com/tc39/proposal-bigint-math/issues/13#issuecomment-919472001 and https://github.com/tc39/proposal-bigint-math/issues/14#issuecomment-918663577.
Unlike with
Math.max
andmin
(see #3), the arguments ofMath.hypot
cannot mix regular numbers and BigInts.This means that we have three choices:
Math.hypot
to accept BigInt arguments.Math.hypot()
with no arguments remains+0
the regular number. We are okay withMath.hypot(...arrOfBigInts)
returning+0
wheneverarrOfBigInts
is empty. (Otherwise, non-integer results truncate, like with BigInt division.)Math.bigHypot
that handles the nullary-arguments case (throwing a TypeError). (Otherwise, non-integer results truncate, like with BigInt division.)hypot
.After hearing feedback from TC39 at the prior presentation, my inclination is with the first choice.