source:
imaps-frontend/node_modules/math-intrinsics/sign.js
Last change on this file was 79a0317, checked in by , 3 days ago | |
---|---|
|
|
File size: 214 bytes |
Line | |
---|---|
1 | 'use strict'; |
2 | |
3 | var $isNaN = require('./isNaN'); |
4 | |
5 | /** @type {import('./sign')} */ |
6 | module.exports = function sign(number) { |
7 | if ($isNaN(number) || number === 0) { |
8 | return number; |
9 | } |
10 | return number < 0 ? -1 : +1; |
11 | }; |
Note:
See TracBrowser
for help on using the repository browser.