naive

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Mod is the global digit mask. Don't change this. Unless you hate yourself.
	Mod = 10000000

	// MaxFives is a value greater than k where k is the largest 5^k factor we expect to encounter
	MaxFives = 16
)

Functions

func Factorial

func Factorial(n int) int

Factorial returns [n!/(2^k*5^k)]%Mod

func Fix

func Fix(f, twos int) int

Fix returns (f*2^twos)%Mod (i.e., it puts back the excess 2's that multiply removed)

func Multiply

func Multiply(x, f, twos int) (int, int)

Multiply returns f and k-j where f=[(x * f) % Mod]/(2^k * 5^j)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL