]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: --exponents: new option for printing in p^e format
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Wed, 27 Apr 2022 10:07:20 +0000 (12:07 +0200)
committerPádraig Brady <P@draigBrady.com>
Mon, 9 May 2022 13:38:01 +0000 (14:38 +0100)
commitf45ab30c0b627099fedf57946a469f8d29a32915
tree8a0a2af97d37e8ea2eb66cbd588102765ab30060
parentddafdae21c574b1dcd5c56e403c82010e7ed3565
factor: --exponents: new option for printing in p^e format

When factoring numbers that have a large 2^n factor, it can be hard to
eyeball just how many 2's there are. Add an option to print each prime
power factor in the p^e format (omitting the exponent when it is 1).

* src/factor.c: Add -h, --exponents option for printing in p^e format.
* doc/coreutils.texi (factor invocation): Document the new option.
* tests/misc/factor.pl: Add test case.
* THANKS.in: Add previous suggester
(https://lists.gnu.org/r/coreutils/2017-11/msg00015.html).

Suggested-by: Emanuel Landeholm <emanuel.landeholm@gmail.com>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
NEWS
THANKS.in
doc/coreutils.texi
src/factor.c
tests/misc/factor.pl