groff-commit
[Top][All Lists]
Advanced

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

[groff] 14/14: groff(1): Improve REPL example.


From: G. Branden Robinson
Subject: [groff] 14/14: groff(1): Improve REPL example.
Date: Tue, 6 Jul 2021 05:05:52 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit f37ad3e1e09768e9652dc0feeeeb047e25120ce1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Jul 6 18:48:03 2021 +1000

    groff(1): Improve REPL example.
    
    Make what's going on with integer division and rounding more clear.
---
 src/roff/groff/groff.1.man | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/roff/groff/groff.1.man b/src/roff/groff/groff.1.man
index e0fd1ab..2453eb5 100644
--- a/src/roff/groff/groff.1.man
+++ b/src/roff/groff/groff.1.man
@@ -896,14 +896,14 @@ $ \c
 .B \[rs]# Let\[aq]s get the result on the standard error stream.
 .B .tm \[rs]n[b]
 3
-.B \[rs]# We can see that the division rounded toward zero.
 .B \[rs]# Now we\[aq]ll define a string.
 .B .ds name Leslie\[rs]" This is another form of comment.
-.B .nr b (\[rs]n[a] + 7/2)
+.B .nr b (\[rs]n[a] + (7/2))
 .B \[rs]# Center the next two text input lines.
 .B .ce 2
 .B Hi, \[rs]*[name].
 .B Your secret number is \[rs]n[b].
+.B \[rs]# We will see that the division rounded toward zero.
 .B It is
 .B \[rs]# Here\[aq]s an if-else control structure.
 .B .ie (\[rs]n[b] % 2) odd.



reply via email to

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