tolassert

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package tolassert provides functions for asserting the equality of numbers with tolerance (in other words, it checks whether numbers are about equal).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[T num.Float](t assert.TestingT, expected T, actual T, msgAndArgs ...any) bool

Equal asserts that the given two numbers are about equal to each other, using a default tolerance of 0.001.

func EqualTol

func EqualTol[T num.Float](t assert.TestingT, expected T, actual, tolerance T, msgAndArgs ...any) bool

EqualTol asserts that the given two numbers are about equal to each other, using the given tolerance value.

func EqualTolSlice

func EqualTolSlice[T num.Float](t assert.TestingT, expected, actual []T, tolerance T, msgAndArgs ...any) bool

EqualTolSlice asserts that the given two slices of numbers are about equal to each other, using the given tolerance value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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