Re: descriptions confusing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/22/2018 08:35 PM, G. Branden Robinson wrote:
> At 2018-08-22T11:19:46-0700, erbenton wrote:
>> Hi,
>>   The description of trunc reads:
>> These functions round x to the nearest integer not larger in absolute value.
>> Which is confusing, can we just say
>> These functions round x to the nearest integer less than the absolute value
>> of x.
>>
>> so round (1.2) becomes  1.0? and round(-1.2) becomes -1.0?
>>
>> I encounter this description style every now and then in man pages and its
>> really confusing.
>> I would search for all instances of "not larger than" and "not less than"
>> and change them to a simplified description.
>> There are other descriptions using different sentence structures that are
>> also like this but use double negatives.
>>  if i come across them again I will let you know.
> 
> Using your language, what happens to "round(1.0)"?
> 
> It must round to 0, because 0 is the largest integer _less than_ 1.
> 
> There is a fundamental difference between open and closed intervals in
> mathematics, and that difference appears here.

Eric, I agree the wording is a little hard to parse, but as Branden notes,
the text is written that way for a reason. But, maybe it could still be a
little easier to read. I reworded as follows (which is now closer to the
text in the C standard):

       These functions round x to the nearest integer value that  is  not
       larger in magnitude than x.

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux