diff --git a/build/math.js b/build/math.js index 3fe3ee0..69b849f 100644 --- a/build/math.js +++ b/build/math.js @@ -2980,9 +2980,7 @@ function floor( x ) { function sign( x ) { - if ( isZero(x) ) - if ( isComplex(x) ) return complex(0); - else return 0; + if ( isZero(x) ) return x; return div( x, abs(x) ); diff --git a/src/functions/miscellaneous.js b/src/functions/miscellaneous.js index af10c4c..9ae78e0 100644 --- a/src/functions/miscellaneous.js +++ b/src/functions/miscellaneous.js @@ -43,9 +43,7 @@ function floor( x ) { function sign( x ) { - if ( isZero(x) ) - if ( isComplex(x) ) return complex(0); - else return 0; + if ( isZero(x) ) return x; return div( x, abs(x) );