bugGNU troff - Bugs: bug #60233, doc/groff.texi: ambiguity in .tkf...

 
 

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

Submitted by:  Dave <barx>
Submitted on:  Sun 14 Mar 2021 11:18:09 PM UTC  
 
Category:  Core Severity:  2 - Minor
Item Group:  Documentation Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 14 Mar 2021 11:18:09 PM UTC, original submission:  

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.

Dave <barx>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by barx (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.6