numeric

package
v0.0.0-...-e9b39da Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package numeric includes various number theoretic algorithms.

Index

Constants

This section is empty.

Variables

View Source
var ErrRange = errors.New("value out of range")
View Source
var ErrSyntax = errors.New("invalid syntax")

Functions

func FastExp

func FastExp(a, n uint64) *big.Int

FastExp computes a^n using exponentiation by squaring (fast exponentiation). a and n are non-negative integers.

func FormatInt

func FormatInt(i int64, base int) string

FormatInt returns the string representation of i in the given base, for 2 <= base <= 36. The result uses the lower-case letters 'a' to 'z' for digit values >= 10.

func ParseInt

func ParseInt(s string, base int) (int64, error)

ParseInt interprets a string s in the given base, for 2 <= base <= 36 and returns the corresponding value. The string may begin with a leading sign: "+" or "-".

Types

This section is empty.

Jump to

Keyboard shortcuts

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