Frontend/25_01_07/mai/node_modules/math-intrinsics/sign.js

12 lines
214 B
JavaScript
Raw Normal View History

2025-01-28 10:38:27 +00:00
'use strict';
var $isNaN = require('./isNaN');
/** @type {import('./sign')} */
module.exports = function sign(number) {
if ($isNaN(number) || number === 0) {
return number;
}
return number < 0 ? -1 : +1;
};