From 29472fc13c4c151fbd432a5a271ff7d0b0af971f Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Wed, 20 Nov 2024 22:08:38 -0500 Subject: Add reciprocoal logarithm to non-compact view Although I have the regular logarithm, its reciprocoal is useful to determine the length of numbers in a certain radix. Like with the totative ratio (where both it and its reciprocoal are useful), I showed both in the regular view and only one in the compact view. --- factor_info.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'factor_info.go') diff --git a/factor_info.go b/factor_info.go index 8939f5a..637bde2 100644 --- a/factor_info.go +++ b/factor_info.go @@ -139,6 +139,8 @@ func (fi *factorInfo) writeTo(w io.Writer) { low_mtc_est, high_mtc_est) } fmt.Fprintf(w, "Base-2 Logarithm: %.3f\n", fi.Log2) + fmt.Fprintf(w, "Number Length: %.4f×Decimal\n", + 1/math.Log10(float64(fi.Radix))) if len(fi.DigitMap) > 0 { writeDigitMap(w, fi.DigitMap) } -- cgit v1.2.3