Skip to content

Conversation

@valadaptive
Copy link
Contributor

The current doc comments say that these behave like one of two operations:

  • fmin/fmax, which return NaN if either operand is NaN, and treat -0.0 as less than 0.0 (this corresponds to IEEE754's minimum and maximum operations).
  • fpmin/fpmax, which return the first operand if either operand is NaN, and also returns the first operand if both are ±0.0.

These are not the only possibilities, however! The specification says that it can also:

  • Return the non-NaN operand if the other is NaN, and treat -0.0 as less than 0.0 (this corresponds to IEEE754's minimumNumber and maximumNumber operations).
  • Behave like fpmin/fpmax but with the operands flipped.
  • Possibly non-deterministically return ±0.0 if both operands are signed zero? The spec is very hard to parse here.

I've chosen to just link to the spec; it's easier than trying to explain the precise semantics.

@rustbot
Copy link
Collaborator

rustbot commented Nov 24, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Amanieu Amanieu added this pull request to the merge queue Nov 28, 2025
Merged via the queue into rust-lang:main with commit 5dceb7a Nov 28, 2025
73 checks passed
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.

3 participants