bigmath

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 3 Imported by: 0

README

bigmath

This package provides mathematical functions that are not provided by the math/big package.

For more information, please go to this page.

Documentation

Overview

This package provides mathematical functions that are not provided by the default math/big package (like logarithm).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatLog10

func FloatLog10(x *big.Float) float64

FloatLog10 returns the decimal logarithm of x which is type *big.Float. The special cases are the same as for Log10. Use Log10 for a more generic function that treats all types of the math/big package (*big.Int, *big.Float, *big.Rat).

func IntLog10

func IntLog10(x *big.Int) float64

IntLog10 returns the decimal logarithm of x which is type *big.Int. The special cases are the same as for Log10. Use Log10 for a more generic function that treats all types of the math/big package (*big.Int, *big.Float, *big.Rat).

func Log10

func Log10(x Big) float64

Log10 returns the decimal logarithm of x. x has to be of type *big.Int, *big.Float or *big.Rat. For example, if x is of type *big.Float, FloatLog10 will be called. Special cases are:

Log(0) = -Inf
Log(x < 0) = NaN

func RatLog10

func RatLog10(x *big.Rat) float64

RatLog10 returns the decimal logarithm of x which is type *big.Rat. The special cases are the same as for Log10. Use Log10 for a more generic function that treats all types of the math/big package (*big.Int, *big.Float, *big.Rat).

Types

type Big

type Big interface {
	Sign() int
}

This interface contains a function Sign common to all 3 types of the big/math package (*big.Int, *big.Float, *big.Rat). If the type is wrong, an error will occurs. Otherwise, a same snippet of code can be used for 3 different types (used in Log10).

Jump to

Keyboard shortcuts

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