Why?
Math methods usually return numbers, signbit returns a Boolean
Math is more focused on proper mathematical operations, Number is more focused on implementation details (like the sign bit of an IEEE-754 float)
Number methods usually don't perform coercion, which may be useful for this proposal
- It's more expected and consistent, it follows the "principle of least surprise"
One problem is handling non-numeric inputs, because it can't rely on coercion, so I suggest throwing an error, returning undefined instead of a bool, or switch to returning Numbers and return NaN
Why?
Mathmethods usually return numbers,signbitreturns aBooleanMathis more focused on proper mathematical operations,Numberis more focused on implementation details (like the sign bit of an IEEE-754 float)Numbermethods usually don't perform coercion, which may be useful for this proposalOne problem is handling non-numeric inputs, because it can't rely on coercion, so I suggest throwing an error, returning
undefinedinstead of a bool, or switch to returningNumbers and returnNaN