Suggest uN::midpoint
over overflow prone (a + b) / 2
expressions
#13849
Labels
A-lint
Area: New lints
uN::midpoint
over overflow prone (a + b) / 2
expressions
#13849
What it does
This lint is would suggest rewrite the not quite correct
(a + b) / 2
expression to the (recently stabilized)uN::midpoint
/iN::midpoint
/fN::midpoint
functions, in order to prevent overflow ofa + b
, which themidpoint
functions handle appropriately.Advantage
Drawbacks
Example
Should be written as:
The text was updated successfully, but these errors were encountered: