math

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package math provides elementary math functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add[T Number](a, b T) T

Add returns a sum of its two parameters. Supports parameters of any integer or float type.

More information on addition can be found at Math is Fun.

Types

type Number

type Number interface {
	constraints.Integer | constraints.Float
}

Number is a constraint that permits any integer or float type.

Relies on golang.org/x/exp/constraints.Integer and golang.org/x/exp/constraints.Float.

Jump to

Keyboard shortcuts

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