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 support #11

Open
3 tasks
smikitky opened this issue Jul 10, 2018 · 7 comments
Open
3 tasks

BigInt support #11

smikitky opened this issue Jul 10, 2018 · 7 comments
Assignees
Labels

Comments

@smikitky
Copy link
Owner

Steps

  • Allow raw bigint values as input (new MultiRange([[555n, 999n]]))
  • Add an option to parse strings as bigint
    new MultiRange('999999999999999999', { bigInt: true });
    // Should throw RangeError without bigInt option
  • Update type definitions after TypeScript officially supports BigInt

We will not do automatic type conversions to/from plain numbers. You should use use either number or bigint exclusively within a single instance of MultiRange.

@smikitky smikitky self-assigned this Jul 10, 2018
@smikitky
Copy link
Owner Author

I will wait until TypeScript supports BigInt (planned in August 2018 according to the latest roadmap).

@1valdis
Copy link

1valdis commented Jul 5, 2019

Any updates on that?

@smikitky
Copy link
Owner Author

smikitky commented Jul 6, 2019

@1valdis Oh, thank you for the interest in this feature :) I started investigating this seriously, and found that there is no way to use Infinity as a literal type in TypeScript... For now, it's difficult to use unbounded ranges along with bigint. Is this limitation important to you?

@1valdis
Copy link

1valdis commented Jul 6, 2019

@smikitky I believe it'll be enough to have bounded ranges for now. How about making just a bounded version, and adding unbounded later (if even)? Throw if trying to use an unbounded initializer with bigint option?

Offtopic
Nice library you have there. I wonder why so few users. It's just ideally what I needed for my lazy rendering of audio frequency graph using Web Audio api. I believe there are much more use cases...

@smikitky
Copy link
Owner Author

smikitky commented Jul 7, 2019

@1valdis Thank you. It turned out that this is painful to implement without the literal Infinity type, so I created an issue in the TypeScript project. Let's see what happens...

@jkchuynh829
Copy link

@smikitky Any chance this still on the roadmap?

@smikitky
Copy link
Owner Author

smikitky commented Mar 2, 2022

@jkchuynh829 I'm still waitng for this issue to be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants