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

Type definitions missing in ceil method #2526

Closed
TomToms55 opened this issue Apr 13, 2022 · 3 comments · Fixed by #2539
Closed

Type definitions missing in ceil method #2526

TomToms55 opened this issue Apr 13, 2022 · 3 comments · Fixed by #2539

Comments

@TomToms55
Copy link

TomToms55 commented Apr 13, 2022

According to Mathjs documentation math.ceil and math.floor support a second argument that is not described in the index.d.ts (eg: math.ceil(x, n) where n is the number of decimals with default value: 0).

Add in index.d.ts:
ceil(x: number, n: number): number;

@TomToms55 TomToms55 changed the title Type definitions missing in ceil, floor methods Type definitions missing in ceil method Apr 13, 2022
@josdejong
Copy link
Owner

Thanks for reporting Tomas.

Anyone able to bring the TypeScript definitions of ceil up to date (and see if similar issues are also behind)?

@gwhitney
Copy link
Collaborator

gwhitney commented Apr 20, 2022

The merged pull request referenced above definitely helps, but it regressed on the contents of AUTHORS (putting Divya Yeruva's dispreferred email address back in), did not actually address #2529 as claimed there, did not add tests for this concern in types/index.ts, and did not address similar issues with floor, fix, and round. I will file a follow-on PR to address these remaining points.

gwhitney added a commit that referenced this issue Apr 21, 2022
  This is a sequel to #2531. Uniformizes the signatures of ceil, fix, floor,
  and round, and updates the TypeScript declarations to match. Adds the
  optional "number of places" argument to the chain versions of ceil, fix,
  and floor. Adds TypeScript tests for all rounding functions.

  Also corrects the TypeScript declaration for `bignumber()` and introduces
  a couple more common abbreviations for TypeScript types.

  Fixes the number-only implementations of floor, ceil, fix, and nthRoot
  to match the full implementation behavior on numbers, and tests this for
  floor.

  Includes some minor documentation updates and additional unit tests for
  the rounding functions.

  Reverts inclusion in AUTHORS of incorrect email for one contributor,
  that occurred in #2531.

  Resolves #2526.
  Resolves #2529.
josdejong pushed a commit that referenced this issue Apr 25, 2022
This is a sequel to #2531. Uniformizes the signatures of ceil, fix, floor,
  and round, and updates the TypeScript declarations to match. Adds the
  optional "number of places" argument to the chain versions of ceil, fix,
  and floor. Adds TypeScript tests for all rounding functions.

  Also corrects the TypeScript declaration for `bignumber()` and introduces
  a couple more common abbreviations for TypeScript types.

  Fixes the number-only implementations of floor, ceil, fix, and nthRoot
  to match the full implementation behavior on numbers, and tests this for
  floor.

  Includes some minor documentation updates and additional unit tests for
  the rounding functions.

  Reverts inclusion in AUTHORS of incorrect email for one contributor,
  that occurred in #2531.

  Resolves #2526.
  Resolves #2529.
@josdejong
Copy link
Owner

Good points Glen, thanks for directly picking this up in #2539.

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.

3 participants