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
Add a lint censuring f32::round and f64::round in favour of the corresponding round_ties_even function. Currently, one can achieve this with
disallowed-methods = [
{ path = "f32::round", reason = "round_ties_even is less biased and faster"},
{ path = "f64::round", reason = "round_ties_even is less biased and faster"},
]
but I think it would be valuable as a separate lint. (Possibly it could be part of in suboptimal_flops, but there's talk about splitting that up already.
What it does
Add a lint censuring
f32::round
andf64::round
in favour of the correspondinground_ties_even
function. Currently, one can achieve this withbut I think it would be valuable as a separate lint. (Possibly it could be part of in
suboptimal_flops
, but there's talk about splitting that up already.For some context, see this issue and this pull request and its tracking issue.
Advantage
Drawbacks
round_ties_even
is a longer name that's harder to read.round
matches more closely the behaviour of the method taught to young children.Example
Could be written as:
The text was updated successfully, but these errors were encountered: