From 7fa8cf9666cd3427dd078bb4a5fdb9fa30c94b09 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Thu, 7 Sep 2023 11:38:32 -0500 Subject: Calculate type of all radices without -l MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit factors.Type now supports all numbers; I have used lookup arrays instead of determining whether a number is SAN or not. There are only 117 elements to store, and this makes the algorithm Θ(1), so it's an improvement. Also, I have changed the size of some integer values to correspond to this change - they now indicate the size of numbers they can accept. The only outputs that are hidden for large radices are: - The digit map, which goes up to 36 because I don't have any more digits beyond that point - The multiplication table complexity, which is estimated above 2^16 (for performance), and can optionally be extended to 2^32 (above this, the output could overflow a uint64). --- args.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'args.go') diff --git a/args.go b/args.go index 99f4874..a211435 100644 --- a/args.go +++ b/args.go @@ -11,10 +11,10 @@ const ProgramVersion = "1.0.0-alpha+dev" // The arguments to this program type args struct { - Radix uint - Compact bool - FullMap bool - LargeCalc bool + Radix uint + Compact bool + FullMap bool + ExactMTCLarge bool // If true, exit the program immediately after parsing args. Exit bool } @@ -25,8 +25,9 @@ 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.") + flag.BoolVar(&a.ExactMTCLarge, "m", false, + fmt.Sprintf("Calculate exact MTC for very large radices (up to %d instead of %d), which may take a while.", + maxExtended, maxNormal)) help := flag.Bool("?", false, "Get information about program usage then exit") version := flag.Bool("V", false, -- cgit v1.2.3