Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Go Report Card GPL license Go Reference

manc

manc provides ancillary math functions for comparing floats in Go.

It has essentially been extracted from the example code of gontract

FloatsAreEqual

The function FloatsAreEqual reports if two floats are approximately equal, taking into account imprecisions of binary representation and rounding.

if manc.FloatsAreEqual(result, expected) {
	// Values are approximately equal.
}

@@ FloatIsZero

The function `FloatIsZero tests if a float is approximately zero.

if manc.FloatIsZero(num) {
	// The number is zero
}

Development

For building and testing, manc needs mage installed in the path as it uses a magefile instead of a Makefile.

Examples:

mage test
mage vet
mage check

About

ancillary math functions for golang

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages