-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Hi there,
Maybe I'm missing something, but could we get some quality of life functions?
For example, you already have isFinite() and isNaN(); to avoid having to create a Decimal for comparison sake, or relying on internal structures within the library that might change, could we have the equivalents of:
From break_infinity.js
isNegativeInfinity() - https://patashu.github.io/break_infinity.js/classes/default.html#isNegativeInfinity
isPositiveInfinity() - https://patashu.github.io/break_infinity.js/classes/default.html#isPositiveInfinity
From decimal.js
isNegative() or isNeg() - https://mikemcl.github.io/decimal.js/#isNeg
isPositive() or isPos() - https://mikemcl.github.io/decimal.js/#isPos
isZero() - https://mikemcl.github.io/decimal.js/#isZero
You could also have isInteger(), isMax(), isMin(), etc.
Hope that helps, thanks for a great library.
Additional:
I know/believe we could do something like this isNegative():
function isNegative(decimal) {
return decimal.sign === -1;
}
or the shorter
if (decimal.sign === -1) {
}
I just feel that a set of standard helper functions would be great, and would help separate our code from internal structures and representations.
Metadata
Metadata
Assignees
Labels
No labels