Re: [NTG-pdftex] [Dev-luatex] What is the unit "nc" supposed to be?
David Kastrup wrote:
But I consider it more likely that nc should be changed to 1370:107
And also, I applied this change to luatex.web (and fixed the documentation sting back). TeX's conversions are approximations anyway, I see little point in changing the conversion arithmetic. Taco
Taco Hoekwater
David Kastrup wrote:
But I consider it more likely that nc should be changed to 1370:107
And also, I applied this change to luatex.web (and fixed the documentation sting back). TeX's conversions are approximations anyway, I see little point in changing the conversion arithmetic.
Well, but I would find a change rendering "1in"="72.27pt" attractive. I'll propose one shortly. Anyway, those fractions carry _way_ more precision than TeX's general arithmetic anyway, and TeX's truncation (which this was all about in the first place) introduces more bias than this particular fraction does. One could argue that 32163:2512 will be a nicer fraction since it overshoots, and TeX forgets to round the final result, so we err on different sides. But I'd rather have the closest ratio and fix TeX's, excuse me (hopefully Knuth didn't hear), LuaTeX's arithmetic on units by letting it round properly. -- David Kastrup
David Kastrup wrote:
Taco Hoekwater
writes: David Kastrup wrote:
But I consider it more likely that nc should be changed to 1370:107
And also, I applied this change to luatex.web (and fixed the documentation sting back). TeX's conversions are approximations anyway, I see little point in changing the conversion arithmetic.
Well, but I would find a change rendering "1in"="72.27pt" attractive. I'll propose one shortly. Anyway, those fractions carry _way_ more precision than TeX's general arithmetic anyway, and TeX's truncation (which this was all about in the first place) introduces more bias than this particular fraction does. One could argue that 32163:2512 will be a nicer fraction since it overshoots, and TeX forgets to round the final result, so we err on different sides.
But I'd rather have the closest ratio and fix TeX's, excuse me (hopefully Knuth didn't hear), LuaTeX's arithmetic on units by letting it round properly.
this is not going to happen soon, maybe a different 'rounding' some day; while developing we need to be able to compare pdftex output with luatex output/processing and implementing a different rounding model is not convenient at this time nobody bothered about that for 25 years so we're not in a great hurry there -) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Taco Hoekwater
David Kastrup wrote:
But I consider it more likely that nc should be changed to 1370:107
And also, I applied this change to luatex.web (and fixed the documentation sting back). TeX's conversions are approximations anyway, I see little point in changing the conversion arithmetic.
Unfortunately, Knuth is a practical joker. The old documentation string, while sounding reassuring, is actually also wrong. With the code he has written there, the requirement is that the _sum_ of num and denum does not exceed 32768. Which happens to be the case for his ratios, but not for _either_ of the new ones. Check the following: This is luaTeX, Version 3.141592-snapshot-2007040210 (Web2C 7.5.6) **\relax *\dimen0=9.9998nd *\showthe\dimen0
7.44438pt. <*> \showthe\dimen0
? *\dimen0=10nd *\showthe\dimen0
10.66977pt. <*> \showthe\dimen0
? * So I recommend that you change the ratio of nd either to 1370:1284 (which reinstates the 12nd=1nc relation), or better change it to the closest usable ratio which is 11183:10481. So it looks like neither the new cicero nor the new didot have a chance to be represented exactly. Too bad. I am still being sidetracked from what I really wanted to look at. Does anybody actually _use_ those new dimensions? -- David Kastrup
David Kastrup wrote:
So I recommend that you change the ratio of nd either to 1370:1284 (which reinstates the 12nd=1nc relation), or better change it to the
I picked that choice for luatex. People would be awfully confused if 12pt!=12pc, so I suspect the same is true for nds and ncs (assuming anyone actually uses these units, which is doubtful at this stage). Taco
2007/4/3, Taco Hoekwater
12pt!=12pc, so I suspect the same is true for nds and ncs (assuming anyone actually uses these units, which is doubtful at this stage).
The bug has been in the wild since 2005-08-01, so I agree: Nobody uses them. Not even the author of the patch. :-{ Best Martin
"Martin Schröder"
2007/4/3, Taco Hoekwater
: 12pt!=12pc, so I suspect the same is true for nds and ncs (assuming anyone actually uses these units, which is doubtful at this stage).
The bug has been in the wild since 2005-08-01, so I agree: Nobody uses them. Not even the author of the patch. :-{
Well, at least not with large numbers behind the decimal point. The nc is rather easy to break with those (0.6nc does the trick), but you have to cherry-pick values for breaking nd (9.99998nd is the smallest value of form x.99998nd that actually breaks). So it is possible that the author uses nd, and possibly multiples of 0.5nc without seeing the problem. -- David Kastrup
Taco Hoekwater
David Kastrup wrote:
So I recommend that you change the ratio of nd either to 1370:1284 (which reinstates the 12nd=1nc relation), or better change it to the
I picked that choice for luatex. People would be awfully confused if 12pt!=12pc,
I'd be confused it it were...
so I suspect the same is true for nds and ncs (assuming anyone actually uses these units, which is doubtful at this stage).
I'd probably prefer the more exact value 11183:10481. Both nc and nd don't exist in the wild, they are only abstract ratios inside of TeX. If people specify a value in the smaller unit nc, they presumably want to have it heeded as well as possible. But since those values differ only in the seventh place, the five-digit precision of TeX's "scaled" values will probably make that difference irrelevant for most applications. Your choice makes x nd equivalent to 12*x nc, where x is a "scaled" 15.16 fixed point number from TeX. I have the sneaking suspicion that Knuth might have known about these units and decided not to put them into TeX since they did not have convenient exact ratios like the others. -- David Kastrup
participants (4)
-
David Kastrup
-
Hans Hagen
-
Martin Schröder
-
Taco Hoekwater