On 27/04/2022 11:07, Rasmus Villemoes wrote:
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 x^y format (omitting the exponent when it is 1).
* src/factor.c: Add --exponents option for printing in x^y format.
Signed-off-by: Rasmus Villemoes <[email protected]>
Thanks for the suggestion.
This is one of those borderline cases.
Mainly because it's fairly easy to postprocess the output.
Consider for example:
$ factor 13 36 | tr ' ' '\n' | uniq -c
1 13:
1 13
1 36:
2 2
2 3
Though for interactive use, the new option is a benefit.
Given the interactive benefit and a previous request to add this functionality¹
I'm tentatively leaning towards adding this.
cheers,
Pádraig
¹ https://lists.gnu.org/archive/html/coreutils/2017-11/msg00015.html