Skip to content

Commit

Permalink
fix(binary): update zero check in floatToSortableInt() (fix #450)
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Feb 19, 2024
1 parent ea302ab commit c2dc294
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/binary/src/float.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const uintBitsToFloat64: FnN2 = (hi, lo) => {
* @param x - value to convert
*/
export const floatToSortableInt: FnN = (x) => {
if (x === -0) x = 0;
if (x === 0) return 0;
const i = floatToIntBits(x);
return x < 0 ? ~i | (1 << 31) : i;
};
Expand Down

0 comments on commit c2dc294

Please sign in to comment.