[texhax] Crosscompilation of TeX
pierre.mackay
pierre.mackay at comcast.net
Tue Mar 14 00:31:54 CET 2006
Uwe Lück wrote:
> At 13:52 11.03.06, Philip TAYLOR wrote:
>
>> Uwe Lück wrote:
>>
>> > At 20:37 10.03.06, Karl Berry wrote:
>> >
>> >> E.g. the ARM-processor does not contain a floating point unit.
>> >>
>> >> There is actually a long-standing (as in decades old) patch from
>> Knuth
>> >> to make the TeX code use only fixed point arithmetic. I admit I
>> am not
>> >> sure whether it's applied in the current distributions.
>> >
>> > According to the Wikipedia article on TeX, "fixed point arithmetic
>> only"
>> > is an essential feature of TeX.
>>
>> Never believe Wikis :-) Fixed-point arithmetic is an essential
>> feature of TeX only where the use of reals could affect DVI output.
>> If you look at TeX.web, you will see that there /are/ places where
>> "foo: real" is used!
>>
>> @!g:real; {a glue ratio, as a floating point number}
>> @!glue_temp:real; {glue value before rounding}
>> @!cur_glue:real; ...
>
>
> Nice to learn, thanks, Phil. At a second reading I am glad
> to see that not my report was wrong, indeed the article doesn't
> mention your qualification. -- It seems that I should read the
> responses from the past night before I send a posting
> the next morning.
>
> And indeed, here is the discussion on the LaTeX list
> that I mentioned:
>
>> Bernd Raichle <raichle at INFORMATIK.UNI-STUTTGART.DE> writes:
>>
>> > This was postponed for e-TeX because (a) the implementation will be
>> > rather tricky for e.g., special nodes and in some contexts where the
>> > result of real arithmetic can be accessed (e.g., \accent
>> > constructions) which will lead to implementation dependend
>> > behaviour.
>>
>> It is my opinion that all of Knuth's attempt to hide the result of
>> real arithmetic in TeX are just a source of pain, trouble and
>> quirkiness, and should stop being a design criterion. It also affects
>> the output of the trip test, making it system-dependent.
>>
>> There are two approaches to get there: either just ignore the system
>> dependencies (PostScript more or less does that, I think, and has not
>> terribly suffered from it), or replace all occurences of real
>> arithmetic by fixed-point arithmetic, and be done. There are change
>> files for that purpose already, if I remember correctly: it was shown
>> that this was feasible.
>>
>> And indeed, given the rather limited amount of real arithmetic in TeX,
>> it should be much easier to make it real-free than its cousin Metafont
>> which managed this feat in spite of _much_ more involved calculations.
>>
>> The inability to access set glue is a _major_ roadblock for quite a
>> few applications.
>>
>> --
>> David Kastrup, Kriemhildstr. 15, 44793 Bochum
>
>
> So I had forgotten that Phil's qualification was part of that discussion,
> here my report was wrong.
>
> -- Uwe.
Before anyone goes any further in this integer vs float, or fixed vs
real discussion, I would
recommend PART 7 of Volume B of "TeX the Program" on "Arithmetic with
Scaled Dimensions."
Knuth makes it very clear why he insisted on integer calculations. It
has to do with the archival
character of TeX files. Section 99 states the case, and section 109
discusses the one exception.
I quote:
This calculation does not affect TeX's decision making, so the
precise details of rounding, etc., in the glue calculation are
not of critical importance for the consistency of results on
different computers. . . . Alternatively it is possible to deal
with glue ratios using nothing but fixed-point arithmetic; see
TUGboat 3.1 (February 1982), 10--27.
See the index, under "float" "float_constant" and "unfloat" for
examples of the care taken to move back and forth from fixed-point
(for "decision-making") real, (where it doesn't matter.)
Pierre MacKay
More information about the texhax
mailing list