librfn
An ad-hoc utility library
fuzz.h
Go to the documentation of this file.
1 /*
2  * fuzz.h
3  *
4  * Part of librfn (a general utility library from redfelineninja.org.uk)
5  *
6  * Copyright (C) 2012-2014 Daniel Thompson <daniel@redfelineninja.org.uk>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published
10  * by the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  */
13 
14 #ifndef RF_FUZZ_H_
15 #define RF_FUZZ_H_
16 
17 #include <assert.h>
18 
34 int fuzzcmp(double a, double b, double delta);
35 
40 int fuzzcmpf(float a, float b, float delta);
41 
44 int fuzzcmpe(double a, double b, double e);
45 
50 int fuzzcmpef(float a, float b, float e);
51 
54 int fuzzcmpb(double a, double b, int bits);
55 
58 int fuzzcmpbf(float a, float b, int bits);
59 
65 #define asserteq(a, b) assert(fuzzcmp(a, b, 1.000010))
66 
68 #endif // RF_FUZZ_H_
struct alpha a
int fuzzcmp(double a, double b, double delta)
Definition: fuzz.c:21
struct bravo b
int fuzzcmpf(float a, float b, float delta)
Definition: fuzz.c:41
int fuzzcmpbf(float a, float b, int bits)
Definition: fuzz.c:79
int fuzzcmpe(double a, double b, double e)
Definition: fuzz.c:61
int fuzzcmpb(double a, double b, int bits)
Definition: fuzz.c:73
int fuzzcmpef(float a, float b, float e)
Definition: fuzz.c:67