Skip to content

encoding: make DecodeFloatDescending return same NaN as ascending#90214

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
michae2:floatdesc
Oct 19, 2022
Merged

encoding: make DecodeFloatDescending return same NaN as ascending#90214
craig[bot] merged 1 commit intocockroachdb:masterfrom
michae2:floatdesc

Conversation

@michae2
Copy link
Copy Markdown
Collaborator

@michae2 michae2 commented Oct 19, 2022

There are multiple representations of NaN in floating point. We were returning a different representation for descending indexes. There are some functions, such as st_makepointm that are sensitive to the difference, and this complicates testing. So let's always return the same bitwise representation for NaN.

Fixes: #89961

Release note: None

@michae2 michae2 requested review from a team, DrewKimball and msirek October 19, 2022 00:11
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Could you add a test as well?

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @msirek)

Copy link
Copy Markdown
Contributor

@msirek msirek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @michae2)

There are multiple representations of NaN in floating point. We were
returning a different representation for descending indexes. There are
some functions, such as `st_makepointm` that are sensitive to the
difference, and this complicates testing. So let's always return the
same bitwise representation for NaN.

Fixes: cockroachdb#89961

Release note: None
@michae2
Copy link
Copy Markdown
Collaborator Author

michae2 commented Oct 19, 2022

Added a test case. TFYRs!

bors r=DrewKimball,msirek

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 19, 2022

Build succeeded:

@craig craig bot merged commit caaf41a into cockroachdb:master Oct 19, 2022
@michae2 michae2 deleted the floatdesc branch October 19, 2022 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

encoding: descending NaN is different from ascending NaN

4 participants