coreutils
[Top][All Lists]
Advanced

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

[PATCH] doc: improve factor example


From: Jim Meyering
Subject: [PATCH] doc: improve factor example
Date: Tue, 20 Dec 2011 14:41:24 +0100

FYI, I read part the "info factor" documentation today
and spotted/fixed a couple of nits in an example:

>From ed71262bc258311690e7761154f8413465d9c78e Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 20 Dec 2011 14:39:57 +0100
Subject: [PATCH] doc: improve factor example

* doc/coreutils.texi (factor invocation): Adjust example to use $(...)
consistently, not a mix of `...` and $(...).  Separate the computation
of the product and the actual factorization, so the timing of the
latter doesn't include the cost of the former.
---
 doc/coreutils.texi |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index c26a53d..c229f98 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -15964,8 +15964,10 @@ factor invocation
 takes about 30 milliseconds of CPU time on a 2.2 GHz Athlon.

 @example
-M8=`echo 2^31-1|bc` ; M9=`echo 2^61-1|bc`
-/usr/bin/time -f '%U' factor $(echo "$M8 * $M9" | bc)
+M8=$(echo 2^31-1|bc)
+M9=$(echo 2^61-1|bc)
+n=$(echo "$M8 * $M9" | bc)
+/usr/bin/time -f %U factor $n
 4951760154835678088235319297: 2147483647 2305843009213693951
 0.03
 @end example
--
1.7.8.354.g4f48c



reply via email to

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