bug-groff
[Top][All Lists]
Advanced

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

[bug #63587] [troff] set .R register to maximum representable integer


From: Dave
Subject: [bug #63587] [troff] set .R register to maximum representable integer
Date: Wed, 12 Apr 2023 14:45:33 -0400 (EDT)

Follow-up Comment #2, bug #63587 (project groff):

I have to update my enthusiasm level from "I like this" to "I'm OK with this,"
because I just discovered there _is_ a way to determine INT_MAX from within
the roff language.  Branden already knew this, having rewritten the relevant
info-manual sentence in 2020: "Within a diversion, in the absence of a
diversion trap, [the .t register] is the largest representable integer in
basic units."

Sure enough:

.di dummy
.nr int_max \n[.t]
.di
.tm int_max is \n[int_max]

spits out "int_max is 2147483646" on stderr.

(It's intriguingly off by one:

$ groff
.nr big1 2147483646
.nr big2 2147483647
.nr big3 2147483648
troff: <standard input>:3: numeric overflow

but close enough for the practical uses for it Branden lists in points 1-3
(and maybe 4, but I confess I don't grok what distinguishes 4 from 3) in his
initial report.)


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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