* setup linting with eslint-config-standard, prettier
* [autofix] npm run lint -- --fix with new setup
* [manual] fix types/ directory errors
* [manual] fix linting errors in test/ directory
* [manual] fix single linting error in src/
* revert ts-expect-error comment change
* error on .only in mocha tests
* fix test description typo
* move some short objects to single line
* add and gitignore eslintcache
* individually suppress ts any
* set --max-warnings to 0
* extract matrices to constants
* update ts-expect-error comments
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.
This is a first step toward full publication of these functions,
that were already being exported by mathjs but had not yet
had the associated actions (documentation/available in
parser/typed, etc.) Also, makes most of them into TypeScript
type guards, and adds Matrix as a constructor type. Resolved#2431.
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
* Add overloads for Matrix add and subtract
* Add check for types/index.ts
* Fix type errors in types/index.ts
* Fix a couple execution errors
* Run test:types as part of test:all
* Fix remaining errors
* Replace types/index.ts comments with asserts
* Add tests for narrowed type inference
* Add dual-purpose comment at top of types/index.ts
* Update AUTHORS
* Use Glen's alternate test:types suggestion
Resolves#1633
Co-authored-by: Hjortur Jonasson <hjorturjonasson@gmail.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
* Fix std and variance type definition
* Fix JSDoc and add overload for var/std of chain
* Fix array type and remove duplicate norm type
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
Allows instantiation of classes (e.g. new ConstantNode(5))
Corrects the default invocation of `rationalize` (the signatures were in
the wrong order---MathNode is now the default return type)
Makes `create` return a `MathJsStatic` rather than
`Partial<MathJsStatic>` which is painful to use and largely unnecessary
because most fields on MathJsStatic are already optional.
Adds convenient aliases for `subtract`
Adds `implicit?: boolean` to MathNode
Make the unit on Unit.toNumber and Unit.toNumeric optional like it is in practice
Represent math.simplify.rules and math.simplify.simplifyCore
* fixing incorrect typing error for floor function
* removing prettier auto format
Co-authored-by: write2kcl <write2kcltech@alamy.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>