Closed domdomegg closed 3 months ago
Thanks for your input, we could indeed improve the TypeScript definitions I think. Help would be welcome.
Fixed now in v12.4.3
Hi. This fix https://github.com/josdejong/mathjs/pull/3198/files broke basic usage:
Now this basic usage is broken.
const quantiles: number[] = math.quantileSeq([1, 2, 3, 4, 5], [0.25, 0.75]) as number[];
This was supported previous to v12.4.3.
Thanks @Loksly. I've raised a PR to fix this: https://github.com/josdejong/mathjs/pull/3223
In the mean time this workaround should work:
const quantiles: number[] = math.quantileSeq([1, 2, 3, 4, 5], [0.25, 0.75]) as unknown as number[];
This fix is now published in v13.0.2
Describe the bug
The types for quantileSeq have an overly wide return type.
To Reproduce
I think value here should always be a number. This is the behaviour of for example
math.mean
andmath.median
.