From 4e1e497fb857a70e59e7f4e176b975c0b7be66bd Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 20 Dec 2005 19:47:32 +0000 Subject: [PATCH] Fix description of rounding to nearest in fixed point to take into account negative numbers. Thanks to Nishit Sureshchandra Shah for the correction. --- doc/44bsd.texi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/44bsd.texi b/doc/44bsd.texi index 3f17918..fc619c1 100644 --- a/doc/44bsd.texi +++ b/doc/44bsd.texi @@ -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} -- 2.30.2