standards/59797: Implement C99's round[f]() math fucntions

Steven G. Kargl kargl at troutmask.apl.washington.edu
Sun Nov 30 15:30:24 PST 2003


The following reply was made to PR standards/59797; it has been noted by GNATS.

From: "Steven G. Kargl" <kargl at troutmask.apl.washington.edu>
To: Stefan Farfeleder <stefan at fafoe.narf.at>
Cc: bug-followup at FreeBSD.org
Subject: Re: standards/59797: Implement C99's round[f]() math fucntions
Date: Sun, 30 Nov 2003 15:21:22 -0800 (PST)

 Stefan Farfeleder wrote:
 > On Sat, Nov 29, 2003 at 10:06:27AM -0800, Steven G. Kargl wrote:
 > > +double round(double x) {
 > > +	double t;
 > > +	if (x >= 0.0) {
 > > +		t = ceil(x);
 > > +		if (t - x > 0.5) t -= 1.0;
 > > +		return t;
 > > +	} else {
 > > +		t = ceil(-x);
 > > +		if (t + x > 0.5) t -= 1.0;
 > > +		return -t;
 > > +	}
 > > +}
 > 
 > One suggestion: Could you make that
 > 
 > +double
 > +round(double x)
 > +{
 > 
 > to match style(9) and (most of) msun/src/*.c?
 > 
 
 I'll submit a style(9) clean-up if the current
 diff is committed.  If you look through msun,
 you'll see all sorts of sytle(9) violations.  
 
 -- 
 Steve
 http://troutmask.apl.washington.edu/~kargl/


More information about the freebsd-standards mailing list