X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=doc%2F44bsd.texi;h=743dad36fca230323600e4f9add0465fcad742df;hp=f1638f80d31daae0739a263d7e5ddaa02583a2b7;hb=12ab4901debfa37cc8a1dd59d5f188788f6bf776;hpb=3b458804e1d0a460fb1c90f06f495b9f7a972424 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