nsimd icon indicating copy to clipboard operation
nsimd copied to clipboard

Strange intrinsic name "round_to_even"

Open eschnett opened this issue 4 years ago • 2 comments

The intrinsic name round_to_even sounds strange. I assume that this is the usual "round to the nearest integer, break ties towards even numbers". However, the name of the intrinsic reads as if it always rounded towards the nearest even number, i.e. as if it never returned an odd number.

eschnett avatar Nov 01 '19 00:11 eschnett

We followed the naming from the R programming language. Cf. https://cran.r-project.org/doc/manuals/r-release/fullrefman.pdf, page 459. Maybe this was a bad idea. What name do you suggest?

gquintin avatar Nov 01 '19 12:11 gquintin

Page 459 of this document refers to the round function; I don't see a round_to_even in the document.

I would have called it round_to_nearest or round_ieee.

I also found this, which lists names used in other languages. It seems that they mostly call it either just round or round_even.

eschnett avatar Nov 01 '19 15:11 eschnett