From dc00f5c20b62de58dbad4b71792632599528c19f Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Mon, 21 Aug 2023 09:46:41 -0500 Subject: Add ln to output A radix's logarithm determines how well it compresses digits - a higher logarithm means numbers will take up fewer digits. If c = log(a)/log(b), then numbers in radix b will be around c times longer than numbers in radix a. --- radix_info.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'radix_info.go') diff --git a/radix_info.go b/radix_info.go index 263909d..8bdfa5b 100644 --- a/radix_info.go +++ b/radix_info.go @@ -3,6 +3,7 @@ package main import ( "aphopkins/radix_info/factors" "fmt" + "math" "os" "slices" "strconv" @@ -22,6 +23,7 @@ func main() { factors.TotativeRatio(n)*100.0) fmt.Println("2345 Rank:", factors.BasicRank(n)) fmt.Println("Multiplication Table Complexity:", factors.MTC(n)) + fmt.Printf("Natural Logarithm: %.2f\n", math.Log(float64(n))) } else { fmt.Println("Argument must be an integer above 1.") } -- cgit v1.2.3