Fix description of rounding to nearest in fixed point to take into
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 20 Dec 2005 19:47:32 +0000 (19:47 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 20 Dec 2005 19:47:32 +0000 (19:47 +0000)
account negative numbers.  Thanks to Nishit Sureshchandra Shah
<nishit@stanford.edu> for the correction.

doc/44bsd.texi

index 3f1791880e82efa6b27677ca2e882e4bf3725058..fc619c1595cd367690815bda13e2070b6a934a1f 100644 (file)
@@ -318,11 +318,12 @@ q}:
 @item Convert @code{n} to fixed point:
 @tab @code{n * f}
 
-@item Convert @code{x} to integer (rounding down):
+@item Convert @code{x} to integer (rounding toward zero):
 @tab @code{x / f}
 
 @item Convert @code{x} to integer (rounding to nearest):
-@tab @code{(x + f / 2) / f}
+@tab @code{(x + f / 2) / f} if @code{x >= 0}, @*
+@code{(x - f / 2) / f} if @code{x <= 0}.
 
 @item Add @code{x} and @code{y}:
 @tab @code{x + y}