Created
October 4, 2016 13:37
-
-
Save mikhailramalho/2d2bf89cf85fe21f8d64de64d7d089ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <math.h> | |
#include <fenv.h> | |
int main (void) { | |
float f; | |
float g; | |
__ESBMC_assume(!isnan(f)); | |
__ESBMC_assume(!isnan(g)); | |
if (f > g) { | |
fesetround(FE_UPWARD); | |
} | |
if (f < g) { | |
fesetround(FE_DOWNWARD); | |
} | |
if ((!isinf(f)) && (g > 0.0f)) { | |
float h = f + g; | |
assert(h >= f); | |
} | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment