Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigInt hypot and the nullary case #6

Closed
js-choi opened this issue Sep 2, 2021 · 1 comment
Closed

BigInt hypot and the nullary case #6

js-choi opened this issue Sep 2, 2021 · 1 comment

Comments

@js-choi
Copy link
Collaborator

js-choi commented Sep 2, 2021

Unlike with Math.max and min (see #3), the arguments of Math.hypot cannot mix regular numbers and BigInts.

This means that we have three choices:

  • We extend Math.hypot to accept BigInt arguments. Math.hypot() with no arguments remains +0 the regular number. We are okay with Math.hypot(...arrOfBigInts) returning +0 whenever arrOfBigInts is empty. (Otherwise, non-integer results truncate, like with BigInt division.)
  • We add a new Math.bigHypot that handles the nullary-arguments case (throwing a TypeError). (Otherwise, non-integer results truncate, like with BigInt division.)
  • We don’t support any BigInt hypot.

After hearing feedback from TC39 at the prior presentation, my inclination is with the first choice.

js-choi added a commit that referenced this issue Sep 3, 2021
js-choi added a commit that referenced this issue Sep 3, 2021
js-choi added a commit that referenced this issue Sep 3, 2021
js-choi added a commit that referenced this issue Sep 3, 2021
@js-choi
Copy link
Collaborator Author

js-choi commented Sep 17, 2021

Closing. hypot has now been completely removed due to lack of use cases.

See #13 (comment) and #14 (comment).

@js-choi js-choi closed this as completed Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant