1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-14 11:21:58 +02:00

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.
This commit is contained in:
Jim Meyering
2011-12-20 14:39:57 +01:00
parent f797c04415
commit ed71262bc2

View File

@@ -15964,8 +15964,10 @@ Factoring the product of the eighth and ninth Mersenne primes
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