Bug 194601 - lround(3) rounding mode description is wrong
Summary: lround(3) rounding mode description is wrong
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-15 16:37 UTC by David Eckardt
Modified: 2017-09-28 06:58 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description David Eckardt 2017-02-15 16:37:30 UTC
The lround(3) manpage implies it rounds all numbers away from zero. This is wrong: It rounds only halfway cases away from zero.
Comment 1 Michael Kerrisk 2017-09-24 07:55:33 UTC
Thanks for the report. I changed the opening sentence to read:

       These functions round their argument to the nearest integer value,
       rounding halfway cases away from zero, regardless of  the  current
       rounding direction (see fenv(3)).
Comment 2 David Eckardt 2017-09-26 17:00:05 UTC
I'm glad to help. Note that not only the sentence you changed is affected but also the NAME section, which incorrectly says:

"lround, lroundf, lroundl, llround, llroundf, llroundl - round to nearest integer, away from zero"

Just for the sake of completeness, I you probably corrected that, too.
Comment 3 Michael Kerrisk 2017-09-28 06:58:38 UTC
Fair enough. But, I decided to just remove the words "away from zero". The reader can of course discover the details in the text.

Note You need to log in before you can comment on or make changes to this bug.