bigmath

package module
v0.0.0-...-c75ff33 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2017 License: BSD-4-Clause Imports: 2 Imported by: 0

README

bigmath
=======

A library of common math functions and constants for `golang <https://golang.org/>`_ `math/big <https://golang.org/pkg/math/big/>`_.

**Mathematical Constants**

- `E <https://en.wikipedia.org/wiki/E_(mathematical_constant)>`_
- `Phi <https://en.wikipedia.org/wiki/Golden_ratio>`_

**Mathematical Functions**

- `Ceil <https://en.wikipedia.org/wiki/Floor_and_ceiling_functions>`_
- `Floor <https://en.wikipedia.org/wiki/Floor_and_ceiling_functions>`_
- `Round <https://en.wikipedia.org/wiki/Rounding>`_
- `Odd <https://en.wikipedia.org/wiki/Even_and_odd_functions#Odd_functions>`_
- `Sqrt <https://en.wikipedia.org/wiki/Newton%27s_method>`_

This project was started because we needed mathematical constants with arbitrary precision. The functions are implemented with the intention of being readable, understandable, and correct rather than fast. Implementations of faster algorithms are planned in the future.

If you've found a bug, open an issue. If you'd like to contribute a new function or have a more efficient implementation of an existing function, feel free to submit a pull request.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ceil

func Ceil(n *big.Rat) *big.Int

func E

func E(rounds uint) *big.Rat

func Floor

func Floor(n *big.Rat) *big.Int

func Mask

func Mask(s uint) *big.Int

func Odd

func Odd(n *big.Int) *big.Int

func Phi

func Phi(precision uint) *big.Rat

func RotateLeft

func RotateLeft(x *big.Int, r uint, s uint, mask *big.Int) *big.Int

func RotateRight

func RotateRight(i *big.Int, r uint, s uint, mask *big.Int) *big.Int

func Round

func Round(n *big.Rat) *big.Int

func Sqrt

func Sqrt(n uint64, p uint) *big.Rat

Types

This section is empty.

Jump to

Keyboard shortcuts

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