scijs / signum

Returns the sign of a number
MIT License
2 stars 0 forks source link

Recommend Sunsetting #1

Open mdhornet90 opened 4 years ago

mdhornet90 commented 4 years ago

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.

soaxelbrooke commented 4 years ago

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 9 months ago

This package is just Math.sign