mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
9 lines
148 B
JavaScript
9 lines
148 B
JavaScript
|
|
Math.sign = Math.sign || function(x) {
|
|
x = +x; // convert to a number
|
|
if (x === 0 || isNaN(x)) {
|
|
return x;
|
|
}
|
|
return x > 0 ? 1 : -1;
|
|
};
|