Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • TODO: ICC and MSVC are also available on Godbolt, but I haven't looked at their output for this. edits welcome... Also: would it be more useful to break down by compiler / version first and then by function within that? Most people aren't going to switch compilers based on how well they compile FP->FP or FP->integer rounding. Commented Nov 17, 2017 at 9:32
  • 2
    +1 for recommending rint() where that is a feasible choice, which is usually the case. I guess the name round() implies to some programmers that this is what they want, while rint() seems mysterious. Note that round() doesn't use a "funky" rounding mode: round-to-nearest-ties-away is an official IEEE-754 (2008) rounding mode. It's curious that nearbyint() doesn't get inlined, given that it is largely the same as rint(), and should be identical under -ffast-math conditions. That looks bug-ish to me. Commented Nov 17, 2017 at 17:01