Re: Interpolation and formatting

2025-02-22 Thread Francesco Ariis
Il 21 febbraio 2025 alle 16:41 G. Branden Robinson ha scritto: > Hi Francesco, > > At 2025-02-21T16:19:25+0100, Francesco Ariis wrote: > > can I format/scale numbers when interpolating them? > > Not without arithmetic, as far as I know. Thanks, my mind is at peace now that I know for sure!

Re: Interpolation and formatting

2025-02-21 Thread onf
On Sat Feb 22, 2025 at 12:21 AM CET, G. Branden Robinson wrote: > At 2025-02-22T00:11:13+0100, onf wrote: > > By the way, Heirloom troff has floating point registers. > > Just converting the type backing groff's registers from `int` to `long` > is a significant refactor, because it implicates other

Re: Interpolation and formatting

2025-02-21 Thread G. Branden Robinson
At 2025-02-22T00:11:13+0100, onf wrote: > By the way, Heirloom troff has floating point registers. Just converting the type backing groff's registers from `int` to `long` is a significant refactor, because it implicates other things like the formatting of diagnostic messages. I found this out whe

Re: Interpolation and formatting

2025-02-21 Thread onf
On Fri Feb 21, 2025 at 11:41 PM CET, G. Branden Robinson wrote: > I further observe that a loss of precision threatens. > > $ cat EXPERIMENTS/unit-conversion.groff > .nf > .nr basic-units-per-cm 1c > There are \n[basic-units-per-cm] basic units per centimeter. > The line length is \n[.l] basic unit

Re: Interpolation and formatting

2025-02-21 Thread G. Branden Robinson
Hi Francesco, At 2025-02-21T16:19:25+0100, Francesco Ariis wrote: > can I format/scale numbers when interpolating them? Not without arithmetic, as far as I know. > Long explanation follows. > > While writing a minimal reproducible example for this list, > I found myself typing: > > Lin

Interpolation and formatting

2025-02-21 Thread Francesco Ariis
Hello groff users, can I format/scale numbers when interpolating them? Long explanation follows. While writing a minimal reproducible example for this list, I found myself typing: Line length is set to: .nr calc \n[.l]/1c \n[calc] Notice how, to interpolate line length in centim