package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Functions

EqualApprox reports whether expected and actual are deeply equal with the following modifications for float64 and float32 types: • If both expected and actual are not NaN or infinite, they are equal within the larger of the relative fraction or absolute margin calculated from the fraction and margin arguments.
FloatArraysCmp returns -1 if aString is less than bString, 0 if they are equal, and 1 otherwise when aString and bString are parsed as SQL float arrays.
FloatArraysMatch returns whether two floating point number arrays represented as strings have matching 15 significant decimal digits (this is the precision that Postgres supports for 'double precision' type) for each element.
FloatArraysMatchApprox returns whether two floating point arrays represented as strings are equal within a tolerance.
FloatsCmp returns -1 if aString is less than bString, 0 if they are equal, and 1 otherwise when aString and bString are parsed as SQL floats.
FloatsMatch returns whether two floating point numbers represented as strings have matching 15 significant decimal digits (this is the precision that Postgres supports for 'double precision' type).
FloatsMatchApprox returns whether two floating point represented as strings are equal within a tolerance.
ParseRoundInStringsDirective parses the directive and returns the number of significant figures to round floats to.
RoundFloatsInString rounds floats in a given string to the given number of significant figures.

# Constants

CloseFraction can be used to set a "close" tolerance for the fraction argument of functions in this package.
CloseMargin can be used to set a "close" tolerance for the margin argument of functions in this package.