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

types: quantileSeq expands types unnecessarily #3197

Open
domdomegg opened this issue Apr 28, 2024 · 1 comment · May be fixed by #3198
Open

types: quantileSeq expands types unnecessarily #3197

domdomegg opened this issue Apr 28, 2024 · 1 comment · May be fixed by #3198

Comments

@domdomegg
Copy link

Describe the bug

The types for quantileSeq have an overly wide return type.

To Reproduce

// Type 'number | BigNumber | Unit | MathArray' is not assignable to type 'number'.
//   Type 'BigNumber' is not assignable to type 'number'.ts(2322)
const value: number = math.quantileSeq([1, 2, 3], 0.90);

I think value here should always be a number. This is the behaviour of for example math.mean and math.median.

@josdejong
Copy link
Owner

Thanks for your input, we could indeed improve the TypeScript definitions I think. Help would be welcome.

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

Successfully merging a pull request may close this issue.

2 participants