Skip to content

Fix NaN handling in compare() function #21016

@Bitshifter-9

Description

@Bitshifter-9
  • Add explicit NaN checks in spaceship helper to ensure it always returns -1, 0, or 1
  • Treat NaN as less than all other numbers and equal to itself for ordering
  • Add comprehensive test coverage for NaN edge cases
  • Fixes potential runtime errors from unexpected NaN return values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions