This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4] Add nextup and nextdown math functions


On Sun, 12 Jun 2016, Rical Jasan wrote:

> > +/* nextdown(x) returns the least floating-point number in the
> > +   format of x less than x.  */
> 
> I was originally trying to discern whether subnormal arguments were
> always normalized, so this comment gave me pause.  By "format" do you
> mean "type"?
> 
> This comment is present in a handful of the files, but not all.  If the
> comment is important, it should probably be present in all of them.
> Also, should it be moved right above the function?  The placement and
> presence are inconsistent throughout.

The correct format, right above the function, does not name the function 
and uses uppercase to refer to values of arguments.

Also, this comment is incorrect.  It returns the *greatest* number less 
than x.  So

/* Return the greatest floating-point number less than X.  */

suffices (the reader can see what the return type of the function is).

> I see a tab made the alignment off in my reply, but I can't find
> anything about whether glibc is spaces-only or not.  Thought I'd point
> out the whitespace issue, though.

glibc uses tabs for indentation as much as possible.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]