mathext

package
v1.0.0-...-e1490ca Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2014 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package mathext contains extensions to the base Go math package.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxBigInt

func MaxBigInt(x, y *big.Int) *big.Int

Returns the larger of x or y.

Example
package main

import (
	"fmt"
	"math/big"

	"gopkg.in/karalabe/cookiejar.v1/exts/mathext"
)

func main() {
	// Define some sample big ints
	four := big.NewInt(4)
	five := big.NewInt(5)

	// Print the minimum and maximum of the two
	fmt.Println("Min:", mathext.MinBigInt(four, five))
	fmt.Println("Max:", mathext.MaxBigInt(four, five))

}
Output:

Min: 4
Max: 5

func MaxBigRat

func MaxBigRat(x, y *big.Rat) *big.Rat

Returns the larger of x or y.

func MaxInt

func MaxInt(x, y int) int

Returns the larger of x or y.

func MinBigInt

func MinBigInt(x, y *big.Int) *big.Int

Returns the smaller of x or y.

func MinBigRat

func MinBigRat(x, y *big.Rat) *big.Rat

Returns the smaller of x or y.

func MinInt

func MinInt(x, y int) int

Returns the smaller of x or y.

Types

This section is empty.

Jump to

Keyboard shortcuts

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