bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #60233] doc/groff.texi: ambiguity in .tkf documentation


From: Dave
Subject: [bug #60233] doc/groff.texi: ambiguity in .tkf documentation
Date: Sun, 14 Mar 2021 19:18:10 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0

URL:
  <https://savannah.gnu.org/bugs/?60233>

                 Summary: doc/groff.texi: ambiguity in .tkf documentation
                 Project: GNU troff
            Submitted by: barx
            Submitted on: Sun 14 Mar 2021 06:18:09 PM CDT
                Category: Core
                Severity: 2 - Minor
              Item Group: Documentation
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

The description of the behavior of the .tkf request in doc/groff.texi contains
a logic error.  It reads:

"if the current point size is less than or equal to S1 the width is increased
by N1; if it is greater than or equal to S2 the width is increased by N2; if
the point size is greater than or equal to S1 and less than or equal to S2 the
increase in width is a linear function of the point size."

Translating these words to pseudocode, where PS is the current point size and
W is the width:

if PS <= S1 then W += N1
if PS >= S2 then W += N2
if (PS >= S1 and PS <= S2) then W += f(PS)

This leaves two cases ambiguously defined: PS == S1 and PS == S2.  In the
above statements, when PS == S1, the first and third conditions both apply;
when PS == S2, the second and third both apply.

In practice, I don't think it matters: I believe (though someone should check
my work) that for the case PS == S1, N1 and f(PS) are the same value;
likewise, for the case PS == S2, N2 and f(PS) are equal.  If this is correct,
the wording can be simplified and freed from ambiguity by striking either the
first two or the last two of the "or equal to" phrases from the above.  (For
ease of reading, I'd strike the last two, since that condition is already more
complicated.)

If my evaluation is not correct, then someone will have to look at the code to
see what is actually done in the PS == S1 and PS == S2 cases, and adjust the
documentation accordingly.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60233>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]