Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrOverflow is returned when an arithmetic operation exceeds the // maximum value that can be represented by the underlying type. ErrOverflow = errors.New("integer overflow") )
Functions ¶
func Add ¶
func Add[T constraints.Unsigned](a, b T) lfn.Result[T]
Add returns the sum of a and b. If the addition overflows the underlying unsigned integer type, an error result is returned.
func CheckAdd ¶
func CheckAdd[T constraints.Unsigned](a, b T) error
CheckAdd checks whether adding a and b would overflow the underlying unsigned integer type.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.