xmath

package
v1.2.3 Latest Latest
Warning

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

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

Documentation

Overview

Copyright (C) Wells Hsu, wellshsu@github.com, All rights reserved. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This license is based on GPL, SEE LICENSE.md FOR MORE DETAILS. Package xmath: 封装了一些常用的数学函数.

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