X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2F44bsd.texi;h=743dad36fca230323600e4f9add0465fcad742df;hb=9f013d0930202eea99c21083b71098a0df64be0d;hp=f1638f80d31daae0739a263d7e5ddaa02583a2b7;hpb=ecad183eed32dd928ec069dbaf944fa0da83eaa3;p=pintos-anon diff --git a/doc/44bsd.texi b/doc/44bsd.texi index f1638f8..743dad3 100644 --- a/doc/44bsd.texi +++ b/doc/44bsd.texi @@ -300,8 +300,8 @@ Suppose that we are using a @m{p.q} fixed-point format, and let @am{f = 2^q, f = 2**q}. By the definition above, we can convert an integer or real number into @m{p.q} format by multiplying with @m{f}. For example, in 17.14 format the fraction 59/60 used in the calculation of -@var{load_avg}, above, is @am{(59/60)2^{14}, 59/60*(2**14)} = 16,111 -(rounded to nearest). To convert a fixed-point value back to an +@var{load_avg}, above, is @am{(59/60)2^{14}, 59/60*(2**14)} = 16,110. +To convert a fixed-point value back to an integer, divide by @m{f}. (The normal @samp{/} operator in C rounds toward zero, that is, it rounds positive numbers down and negative numbers up. To round to nearest, add @m{f / 2} to a positive number, or