diff options
| author | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2023-08-21 09:46:41 -0500 |
|---|---|---|
| committer | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2023-08-21 09:56:06 -0500 |
| commit | dc00f5c20b62de58dbad4b71792632599528c19f (patch) | |
| tree | 8d08b66ebe412c43f01c969aec4662c333d74e0c /radix_info.go | |
| parent | 547c63fbf0c6dd673e8caf83ea7f9eeb679b5f5c (diff) | |
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.
Diffstat (limited to 'radix_info.go')
| -rw-r--r-- | radix_info.go | 2 |
1 files changed, 2 insertions, 0 deletions
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.") } |
