summaryrefslogtreecommitdiff
path: root/factor_info.go
diff options
context:
space:
mode:
Diffstat (limited to 'factor_info.go')
-rw-r--r--factor_info.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/factor_info.go b/factor_info.go
index 1988b2c..8939f5a 100644
--- a/factor_info.go
+++ b/factor_info.go
@@ -55,11 +55,9 @@ type factorInfo struct {
// This is not calculated if the radix is too large - in this case
// this field will be nil.
MTC *uint64
- // The radix's natural logarithm. This determines the length of numbers
- // in this radix - higher Ln means numbers 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.
- Ln float64
+ // The radix's base-2 logarithm.
+ // One digit in this radix is equivalent to this many bits.
+ Log2 float64
// Information about each digit's compatibility with the radix.
// This determines what kind of decimal expansion the digit's
// reciprocoal has and what patterns are in its row of the multiplication
@@ -113,7 +111,7 @@ func getFactorInfo(a args) *factorInfo {
return &factorInfo{radix, factors.PrimeFactorize(radix),
r_factors, factors.Score(radix), totativeCount, totativeRatio,
totativeDigits, factors.BasicRank(radix), factors.Type(radix),
- mtc_ptr, math.Log(float64(radix)), digitMap}
+ mtc_ptr, math.Log2(float64(radix)), digitMap}
}
func (fi *factorInfo) writeTo(w io.Writer) {
@@ -140,7 +138,7 @@ func (fi *factorInfo) writeTo(w io.Writer) {
"Multiplication Table Complexity is between %.6g and %.6g.\n",
low_mtc_est, high_mtc_est)
}
- fmt.Fprintf(w, "Natural Logarithm: %.3f\n", fi.Ln)
+ fmt.Fprintf(w, "Base-2 Logarithm: %.3f\n", fi.Log2)
if len(fi.DigitMap) > 0 {
writeDigitMap(w, fi.DigitMap)
}
@@ -157,7 +155,7 @@ func (fi *factorInfo) writeToCompact(w io.Writer) {
high_mtc_est := float32(fi.Radix) * float32(fi.Radix-2)
fmt.Fprintf(w, "%.4g ≤ MTC ≤ %.4g | ", low_mtc_est, high_mtc_est)
}
- fmt.Fprintf(w, "ln: %.2f", fi.Ln)
+ fmt.Fprintf(w, "log2: %.2f", fi.Log2)
fmt.Fprintln(w)
if len(fi.DigitMap) > 0 {
writeDigitMapCompact(w, fi.DigitMap)