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

Accept options as 3rd parameter; Fix a spec bug that value might overflow #27

Merged
merged 3 commits into from
May 14, 2020

Conversation

Jack-Works
Copy link
Member

@Jack-Works Jack-Works commented May 12, 2020

Related: #25

  • Add options: {step?}
  • Fix spec bug Number.range(0, 5, 1.5) will emit 6 as final value
  • Fix spec bug (from, to] to [from, to) (the design is [from, to) currently, so it's a bug if you want to inclusive range please check Inclusive range #26)

@@ -3,7 +3,7 @@
// This polyfill requires: globalThis, BigInt & private fields
;(() => {
// Math.abs does not support BigInt.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this. Math.abs doesn't support BigInt. Does there any solution or I have to write an abs function myself?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no built-in function for this, but I think @ljharb was interested in a proposal to relax this restriction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all Math methods where it makes sense should accept all number types, yes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, Math.sign should support bigint too. Is there a plan for it? @ljharb

@Jack-Works Jack-Works mentioned this pull request May 14, 2020
@Jack-Works Jack-Works merged commit e23aa62 into master May 14, 2020
@Jack-Works Jack-Works deleted the accept-options branch May 14, 2020 17:48
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

Successfully merging this pull request may close these issues.

3 participants