mathutil

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package mathutil implements some functions for math calculation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exponent

func Exponent(x, n int64) int64

Exponent calculate x^n

func Factorial

func Factorial(x uint) uint

Factorial calculate x!

func Fibonacci

func Fibonacci(first, second, n int) int

Fibonacci calculate fibonacci number before n

func Percent

func Percent(val, total float64, n int) float64

Percent calculate the percentage of val to total

func RoundToFloat

func RoundToFloat(x float64, n int) float64

RoundToFloat round up to n decimal places

func RoundToString

func RoundToString(x float64, n int) string

RoundToString round up to n decimal places

func TruncRound

func TruncRound(x float64, n int) float64

TruncRound round off n decimal places

Types

This section is empty.

Jump to

Keyboard shortcuts

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