scijs/signum

Recommend Sunsetting

mdhornet90 opened this issue · 2 comments

Numerous advancements in the javascript language, particularly performance improvements in the parser, have made this kind of code portable enough that it no longer needs to be a library function. Recommend deprecating this library.

There is a migration path for vanilla JS available also:

let sgn = x => x > 0 ? 1 : x < 0 ? -1 : 0;
console.log(sgn(100));
console.log(sgn(-100));
console.log(sgn(Infinity));
1j01 commented

This package is just Math.sign