Why do lots of (old) programs use floor(0.5 + input) instead of round(input)? – stackoverflow.com

The differences reside in the returned value giving inputs around tie-breaking I believe, such as this code: int main() { std::cout.precision(100); double input = std::nextafter(0.05, 0.0) / ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Why do lots of (old) programs use floor(0.5 + input) instead of round(input)? – stackoverflow.com"