number

package
v0.0.0-...-9094145 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanTruncate

func CanTruncate(from Type, to Type, value interface{}) bool

CanTruncate checks if a float (from) can be converted to an int (to)

func Max

func Max(t Type) uint64

func Min

func Min(t Type) uint64

Types

type TrapCode

type TrapCode byte
const (
	NoTrap      TrapCode = 0
	NanTrap     TrapCode = 1
	ConvertTrap TrapCode = 2
)

func FloatTruncate

func FloatTruncate(from Type, to Type, floatBits uint64) (uint64, TrapCode)

FloatTruncate truncates a float represented by floatBits to an integer (signed or unsigned) when it cannot perform the operation it returns the corresponding trap codes

type Type

type Type byte
const (
	I32 Type = iota
	U32
	I64
	U64
	F32
	F64
)

Jump to

Keyboard shortcuts

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