We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba8a2d5 commit 0285e63Copy full SHA for 0285e63
1 file changed
packages/pretty-format/src/index.js
@@ -80,11 +80,7 @@ function isToStringedArrayType(toStringed: string): boolean {
80
}
81
82
function printNumber(val: number): string {
83
- if (val != +val) {
84
- return 'NaN';
85
- }
86
- const isNegativeZero = val === 0 && 1 / val < 0;
87
- return isNegativeZero ? '-0' : '' + val;
+ return Object.is(val, -0) ? '-0' : String(val);
88
89
90
function printFunction(val: Function, printFunctionName: boolean): string {
0 commit comments