-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Documentation for {f32, f64}::hypot should clarify its behavior for negative values. #88944
Copy link
Copy link
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The documentation for the
f32::hypot/f64::hypotfunction readsand gives this example (and the analogous example for
f64):Since lengths are always positive, it's unclear what this function does for negative values. My expectation is that it gives the hypotenuse of the right triangle whose leg lengths are the absolute values of
xandy, but I had to look up the relevant libc documentation to be sure, which reads