diff --git a/build/mathcell.js b/build/mathcell.js index 824b3fe..b92dbb5 100644 --- a/build/mathcell.js +++ b/build/mathcell.js @@ -1735,9 +1735,9 @@ var colormaps = Object.assign( {}, matplotlib, mathematica ); function checkValue( x ) { - // denominator must be greater than rounding decimal places downstream - if ( x === Infinity ) return Number.MAX_VALUE / 1e5; - if ( x === -Infinity ) return -Number.MAX_VALUE / 1e5; + // be aware of rounding decimal places downstream + if ( x === Infinity ) return 1e300; + if ( x === -Infinity ) return -1e300; if ( isNaN(x) ) { console.log( 'NaN converted to zero while plotting' ); diff --git a/src/plot/functions.js b/src/plot/functions.js index 89ae7d3..2840ce8 100644 --- a/src/plot/functions.js +++ b/src/plot/functions.js @@ -4,9 +4,9 @@ function checkValue( x ) { - // denominator must be greater than rounding decimal places downstream - if ( x === Infinity ) return Number.MAX_VALUE / 1e5; - if ( x === -Infinity ) return -Number.MAX_VALUE / 1e5; + // be aware of rounding decimal places downstream + if ( x === Infinity ) return 1e300; + if ( x === -Infinity ) return -1e300; if ( isNaN(x) ) { console.log( 'NaN converted to zero while plotting' );