numeric

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFromPtr

func ExtractFromPtr[T Number](p *T) T

ExtractFromPtr 若入参指针为nil,则返回0;否则,返回指针指向的内存所存储的值。

func PositiveToPtr

func PositiveToPtr[T Number](v T) *T

PositiveToPtr 若入参v大于零,则返回其指针;否则返回nil。

Types

type Number

type Number interface {
	~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uint | ~float32 | ~float64
}

Jump to

Keyboard shortcuts

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