File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 806806 }
807807
808808 // Estimate.
809- s = Math . sqrt ( x + '' ) ;
809+ s = Math . sqrt ( + stringify ( x , true , true ) ) ;
810810
811811 // Math.sqrt underflow/overflow?
812812 // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
971971 * Return the value of this Big as a primitve number.
972972 */
973973 P . toNumber = function ( ) {
974- var n = Number ( stringify ( this , true , true ) ) ;
974+ var n = + stringify ( this , true , true ) ;
975975 if ( this . constructor . strict === true && ! this . eq ( n . toString ( ) ) ) {
976976 throw Error ( NAME + 'Imprecise conversion' ) ;
977977 }
Original file line number Diff line number Diff line change @@ -803,7 +803,7 @@ P.sqrt = function () {
803803 }
804804
805805 // Estimate.
806- s = Math . sqrt ( x + '' ) ;
806+ s = Math . sqrt ( + stringify ( x , true , true ) ) ;
807807
808808 // Math.sqrt underflow/overflow?
809809 // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
@@ -968,7 +968,7 @@ P[Symbol.for('nodejs.util.inspect.custom')] = P.toJSON = P.toString = function (
968968 * Return the value of this Big as a primitve number.
969969 */
970970P . toNumber = function ( ) {
971- var n = Number ( stringify ( this , true , true ) ) ;
971+ var n = + stringify ( this , true , true ) ;
972972 if ( this . constructor . strict === true && ! this . eq ( n . toString ( ) ) ) {
973973 throw Error ( NAME + 'Imprecise conversion' ) ;
974974 }
You can’t perform that action at this time.
0 commit comments