Should the docstring for div
clarify floating-point behaviour as in fld
?
#55837
Labels
div
clarify floating-point behaviour as in fld
?
#55837
At least until
div
is fixed for floats (#49561).At the moment the docstrings for
div
refer only to integers, but there's no type restriction on the inputs which leads to a discrepancy if called with floats:This is of course because decimals such as 0.1 don't have an exact floating-point representation so the result can differ when rounded down; the docstring for
fld
includes this warning, butdiv
does not, so even simple operations such as1.0 ÷ 0.1
can lead to unintuitive results if this is not specified.The text was updated successfully, but these errors were encountered: