From 55981e7bb325f5dc84384e90c76a7f29005d62f8 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Tue, 5 Sep 2023 12:36:52 -0500 Subject: Treat radices >2^16 as large unless -l set These radices are large enough that: - there is no reason to use them as actual radices - calculating them takes a lot of time! Therefore, the exact MTC and radix type shouldn't be calculated by default. If you want to take the time, you still can with -l. I am keeping the original 2^32 limit even with -l, because the problem with that is not performance, it is that the resulting MTC could overflow a uint64 (also the CAN list only goes up to this range). --- args.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'args.go') diff --git a/args.go b/args.go index f2ede5d..99f4874 100644 --- a/args.go +++ b/args.go @@ -11,9 +11,10 @@ const ProgramVersion = "1.0.0-alpha+dev" // The arguments to this program type args struct { - Radix uint - Compact bool - FullMap bool + Radix uint + Compact bool + FullMap bool + LargeCalc bool // If true, exit the program immediately after parsing args. Exit bool } @@ -24,6 +25,8 @@ func parseArgs() (args, error) { flag.BoolVar(&a.FullMap, "f", false, fmt.Sprintf("Show full digit map (up to %d) for every radix", maxSmallRadix)) + flag.BoolVar(&a.LargeCalc, "l", false, + "Calculate exact MTC and radix class for very large radices, which may take a while.") help := flag.Bool("?", false, "Get information about program usage then exit") version := flag.Bool("V", false, -- cgit v1.2.3