softfloat64

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

README

softfloat64

Software implementation of binary 64-bit floating-point. Based in ucb-bar/berkeley-softfloat-3, ported to pure Golang.

This is not a comprehensive implementation, only the required operations on RandomX have been implemented (plus subnormals / NaN / Inf handling). If you would like any other operations added, change requests will be reviewed regularly.

Documentation

Index

Constants

View Source
const (
	// RoundingModeToNearest IEEE 754 roundTiesToEven / softfloat_round_near_even
	RoundingModeToNearest = RoundingMode(iota)

	// RoundingModeToNegative IEEE 754 roundTowardNegative / softfloat_round_min
	RoundingModeToNegative

	// RoundingModeToPositive IEEE 754 roundTowardPositive / softfloat_round_max
	RoundingModeToPositive

	// RoundingModeToZero IEEE 754 roundTowardZero / softfloat_round_minMag
	// TODO: unused???
	RoundingModeToZero
)

Variables

This section is empty.

Functions

func Add

func Add(a, b float64, mode RoundingMode) float64

func Div

func Div(a, b float64, mode RoundingMode) float64

func Int32ToFloat64

func Int32ToFloat64(a int32) float64

func Int64ToFloat64

func Int64ToFloat64(a int64, mode RoundingMode) float64

func IsNaN

func IsNaN(a float64) bool

func Mul

func Mul(a, b float64, mode RoundingMode) float64

func Sqrt

func Sqrt(a float64, mode RoundingMode) float64

func Sub

func Sub(a, b float64, mode RoundingMode) float64

func Uint32ToFloat64

func Uint32ToFloat64(a uint32) float64

func Uint64ToFloat64

func Uint64ToFloat64(a uint64, mode RoundingMode) float64

Types

type RoundingMode

type RoundingMode uint8

Jump to

Keyboard shortcuts

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