viewing long pages, evince seems to choke on simple test file

Reinhard Kotucha reinhard.kotucha at web.de
Tue Sep 10 00:32:37 CEST 2019


On 2019-09-09 at 11:46:05 -0600, Doug McKenna wrote:

 > Mike Marchywka wrote:
 >
 > >| Was there some reason known for this
 > >| or as the other response suggested this
 > >| was back in the day of 32 or 16 bit integers?
 >
 > TeX uses 32-bits as the word size of integers, with the upper 16
 > bits the signed integer part of a fixed point "Dimension" and the
 > lower 16 bits for the fractional part.  But the connection to the
 > real world is that the low-order 16 bits measure 1/65536th of a
 > point, each point being 72.27 per inch.  Had these bits measured
 > 1/10000th of a point, Knuth would have avoided some input/output
 > round-off problems, and would have increased the dynamic range of a
 > Dimension by a factor of 6 or so, with attendant loss of precision.
 > C'est la vie.

I don't think that Knuth would have avoided any rounding errors by
using decimal numbers.  Computers still use the binary system
internally.  Rounding errors occur when you convert binary numbers to
decimal and vice versa.  Of course, this is quite confusing to humans.
But keep in mind that even the decimal number 0.1 cannot be
represented in the binary system with a finite amount of binary
digits.

Given that Knuth did not consider printing on toilet paper, his
decision was quite reasonable.  He used floating point numbers at the
beginning but switched to fixed point integer numbers when he noticed
that he got different results on different machines.

Sure, more than 32 bit for dimensions would be quite nice in some
special cases but after all, he wrote TeX in order to write his own
books in the first place.  Much more annoying is the limited range in
Metapost because you often have to do extensive calculations in order
to determine dimensions, hence intermediate results are likely to
cause an overfow.

 > On today's 64-bit machines, one (ahem!) might configure a
 > TeX-language interpreter at compile time to use [48:16] fixed-point
 > arithmetic, which would allow a single page to be about 30 million
 > miles long.  Sadly, that unrolled scroll would make it only about
 > 20% of the way to Mars.

This doesn't make much sense either because PDF (at least 1.4) has similar
limitations.  Only a homemade DVI driver could extend the range, but
it could also scale the page so that the range of TeX's dimensions can
be left as it is.

BTW, there is a nice TUGboat article by Nelson Beebe about different
representations of numbers and their quirks:

  https://tug.org/TUGboat/tb28-3/tb90beebe.pdf

Regards,
  Reinhard

--
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------



More information about the texhax mailing list