Documentation ¶
Overview ¶
Package suite provides a simple API for parsing and using IBM Labs' "Floating-Point Test-Suite for IEEE"
This package is deprecated and will be removed in the next major version.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case struct { Prefix string Prec int Op Op Mode big.RoundingMode Trap Condition Inputs []Data Output Data Excep Condition }
Case represents a specific test case.
Here's a nice ascii diagram:
prec trap excep | | | |\ | | vv v v d64+ =0 i 100 200 -> 300 i ^ ^ ^^ ^^^ ^^^ ^ ^^^ | | \| \|/ \|/ | \|/ | | | | | | | | | mode \ / | output | op | output delim prefix inputs
func ParseCases ¶
ParseCases returns a slice of test cases in .fptest form read from r.
func (Case) ShortString ¶
ShortString returns the same as String, except long data values are capped at length digits.
type Condition ¶
type Condition uint32
Condition is a bitmask value raised after or during specific operations.
func ConditionFromString ¶
type Data ¶
type Data string
Data is input or output from a test case.
const NoData Data = "#"
NoData is output when the operation throws some sort of Condition and does not "return" any data.
type Op ¶
type Op uint8
Op is a specific operation the test case must perform.
const ( Add Op = iota // add Sub // subtract Mul // multiply Div // divide FMA // fused multiply-add Sqrt // square root Rem // remainder RFI // round float to int CFF // convert between floating point formats CFI // convert float to integer CIF // convert integer to float CFD // convert to string CDF // convert string to float QuietCmp // quiet comparison SigCmp // signaling comparison Copy // copy Neg // negate Abs // absolute value CopySign // copy sign Scalb // scalb Logb // logb NextAfter // next after Class // class IsSigned // is signed IsNormal // is norm IsInf // is inf IsZero // is zero IsSubNormal // is subnormal IsNaN // is nan IsSignaling // is signaling IsFinite // is finite MinNum // minnum MaxNum // maxnum MinNumMag // minnummag MaxNumMag // maxnummag SameQuantum // same quantum Quantize // quantize NextUp // next up NextDown // next down Equiv // equivalent // Custom SetRat Sign Signbit Exp Log Log10 Pow IntDiv Normalize RoundToInt Shift )