biguint

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

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 2 Imported by: 0

README

biguint

This is a Go package providing basic arithmetic operators - add, subtract, multiply, divide, exponentiation - for arbitrary-length unsigned integers.

It was written as an exercise to teach myself Go basics.

Documentation

Overview

biguint implements the standard arithmetic operators - addition, subtraction, multiplication, division - for arbitrary-length unsigned integers. Arguments are passed and results are returned as strings of integers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(strn ...string) (string, error)

Add returns the sum of any number of unsigned integers.

func Divide

func Divide(str1, str2 string) (string, error)

Divide returns the result of integer division of two unsigned integers. The smaller number is the divisor.

func Exp

func Exp(str1, str2 string) (string, error)

Exp returns the result of a biguint raised to a biguint power.

func Multiply

func Multiply(str1, str2 string) (string, error)

Multiply returns the product of two unsigned integers.

func Subtract

func Subtract(str1, str2 string) (string, error)

Subtract returns the absolute difference between two unsigned integers.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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