Documentation ¶
Index ¶
- func Add[T constraints.Number](x, y T) T
- func CeilToSigFigs[T float32 | float64](x T, n int) T
- func FloorToSigFigs[T float32 | float64](x T, n int) T
- func GCD[T go_constraints.Integer](a, b T) T
- func LCM[T go_constraints.Integer](a, b T) T
- func Max[T constraints.Number](x, y T) T
- func Min[T constraints.Number](x, y T) T
- func RoundToSigFigs[T float32 | float64](x T, n int) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add[T constraints.Number](x, y T) T
func CeilToSigFigs ¶
Rounds the given number up to n significant figures.
func FloorToSigFigs ¶
Rounds the given number down to n significant figures.
func GCD ¶
func GCD[T go_constraints.Integer](a, b T) T
Assumes positive inputs. Adapted from https://en.wikipedia.org/wiki/Euclidean_algorithm#Implementations.
func Max ¶
func Max[T constraints.Number](x, y T) T
func Min ¶
func Min[T constraints.Number](x, y T) T
func RoundToSigFigs ¶
Rounds the given number to n significant figures.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.