xmath

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: GPL-2.0, GPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

封装了一些常用的数学函数.

Index

Constants

View Source
const (
	INT8_MIN   = -0x7f - 1
	INT16_MIN  = -0x7fff - 1
	INT32_MIN  = -0x7fffffff - 1
	INT64_MIN  = -0x7fffffffffffffff - 1
	INT8_MAX   = 0x7f
	INT16_MAX  = 0x7fff
	INT32_MAX  = 0x7fffffff
	INT64_MAX  = 0x7fffffffffffffff
	UINT8_MAX  = 0xff
	UINT16_MAX = 0xffff
	UINT32_MAX = 0xffffffff
	UINT64_MAX = 0xffffffffffffffff
)

Variables

View Source
var (
	BYTE_ORDER binary.ByteOrder = &binary.LittleEndian // 字节序(小端)
)

Functions

func MaxValue

func MaxValue(a int, b int) int

最大值

func MinValue

func MinValue(a int, b int) int

最小值

func RandInt

func RandInt(min int, max int) int

随机数

min: 左区间
max: 右区间

func Uint32FromBytes

func Uint32FromBytes(value []byte) uint32

字节数组转uint32

func Uint32ToBytes

func Uint32ToBytes(value uint32) []byte

uint32转字节数组

Types

This section is empty.

Jump to

Keyboard shortcuts

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