builtin

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(a bool, b bool) bool

func BitwiseAnd

func BitwiseAnd[T constraints.Integer](a T, b T) T

func BitwiseAndNot

func BitwiseAndNot[T constraints.Integer](a T, b T) T

BitwiseAndNot wraps the `&^` operator

func BitwiseOr

func BitwiseOr[T constraints.Integer](a T, b T) T

func BitwiseXor

func BitwiseXor[T constraints.Integer](a T, b T) T

func Dereference

func Dereference[A any](a *A) A

func Divide

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

func EQ

func EQ[T comparable](a T, b T) bool

func GT

func GT[T constraints.Ordered](a T, b T) bool

func GTE

func GTE[T constraints.Ordered](a T, b T) bool

func Index

func Index[A any](i int, xs []A) A

Index wraps the [] operator

func LT

func LT[T constraints.Ordered](a T, b T) bool

func LTE

func LTE[T constraints.Ordered](a T, b T) bool

func LeftShift

func LeftShift[T constraints.Integer](bits T, numberOfBits uint) T

func MapGet

func MapGet[A comparable, B any](a A, m map[A]B) B

func Max added in v0.2.3

func Max[T constraints.Ordered](a T, b T) T

func Min added in v0.2.3

func Min[T constraints.Ordered](a T, b T) T

func Minus

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

func Modulo

func Modulo[T constraints.Integer](a T, b T) T

func NE

func NE[T comparable](a T, b T) bool

func Negate

func Negate[T Number](a T) T

func Not

func Not(a bool) bool

func Or

func Or(a bool, b bool) bool

func Plus

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

func Reference

func Reference[A any](a A) *A

func RightShift

func RightShift[T constraints.Integer](bits T, numberOfBits uint) T

func Slice

func Slice[A any](start uint, stop uint, xs []A) []A

func SliceFrom

func SliceFrom[A any](start uint, xs []A) []A

func SliceTo

func SliceTo[A any](stop uint, xs []A) []A

func Times

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

Types

type Number

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

Number is built out of:

https://pkg.golang.ir/golang.org/x/[email protected]/constraints

Jump to

Keyboard shortcuts

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