[tex-k] correct answer changed to wrong answer in errata.tex (C250 entry)
胡亚捷 (Hu Yajie)
2500418497 at qq.com
Sun Jul 12 04:59:05 CEST 2020
Page C250, line 13
Could `(odd n) and not (odd -n)' possibly be true? The old answer says
Yes, if and only if n-1/2 is an even integer. (Because ambiguous values are
rounded up.)
The new answer since 2008 (cf. errata.tex) says
Yes, if and only if n-1/2 is a nonnegative even integer. (Because ambiguous
values are rounded up.)
However, on my machine (MiKTeX & TeX Live 2017/Debian) the old answer was
right, and the new answer turns out to be wrong!
*n=-3.5; show (odd n) and not (odd -n);
>> true
Section 906 of Volume D says that the `odd' operation is done in Pascal as
`odd(round_unscaled(cur_exp))', where round_unscaled (section 119) calculates
the mathematical function floor(x/2^16+.5) regardless of sign. Therefore we
want floor(N/2^16+.5) to be odd and floor(-N/2^16+.5) = -ceiling(N/2^16+.5)+1
to be even, where N is the scaled representation of n, and this means that
both floor(N/2^16+.5) and ceiling(N/2^16+.5) should be odd. Thus N/2^16+.5 is
integer and odd, which is equivalent to saying that n-1/2 is an even integer.
(Well, you can also say `N=0; vardef n = incr N enddef;' but that's cheating.)
Incidentally, this answer uses the phrase `if and only if', so it might make
sense to use it for answer 22.1 (page C251, line -3) as well.
More information about the tex-k
mailing list.