Skip to content

Commit c2dc294

Browse files
fix(binary): update zero check in floatToSortableInt() (fix #450)
1 parent ea302ab commit c2dc294

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/binary/src/float.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const uintBitsToFloat64: FnN2 = (hi, lo) => {
7373
* @param x - value to convert
7474
*/
7575
export const floatToSortableInt: FnN = (x) => {
76-
if (x === -0) x = 0;
76+
if (x === 0) return 0;
7777
const i = floatToIntBits(x);
7878
return x < 0 ? ~i | (1 << 31) : i;
7979
};

0 commit comments

Comments
 (0)