You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make Math/MathF.Sign inlineable for floating point data #57413
Math/MathF.Sign for floating point data currently isn't inlined, probably due to the throw there. Since it's a simple math operation, it should probably be inlined.
It's probably not worthwhile to make this inlineable. If perf is a consideration (and even if it isn't) then double/float.IsNegative or Math/MathF.CopySign is probably better.
The only consideration really is that these correctly report or propagate -0 and -NaN (that is, IsNegative reports true for negative zero and negative NaN; and CopySign will do the same, copying the sign to or from such inputs).
Activity
tannergooding commentedon Feb 18, 2022
It's probably not worthwhile to make this inlineable. If perf is a consideration (and even if it isn't) then
double/float.IsNegativeorMath/MathF.CopySignis probably better.The only consideration really is that these correctly report or propagate
-0and-NaN(that is,IsNegativereports true fornegative zeroandnegative NaN; andCopySignwill do the same, copying the sign to or from such inputs).dakersnar commentedon Nov 29, 2022
Closing this for reasons explained above.