|
From: | Pádraig Brady |
Subject: | Re: [PATCH 1/2] factor: add option for printing in x^y format |
Date: | Wed, 27 Apr 2022 15:14:46 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Thunderbird/97.0 |
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 <rasmus.villemoes@prevas.dk>
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
[Prev in Thread] | Current Thread | [Next in Thread] |