Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created August 24, 2016 12:03
Show Gist options
  • Save KristianLyng/cea60419e449482c5f30c13406abf549 to your computer and use it in GitHub Desktop.
Save KristianLyng/cea60419e449482c5f30c13406abf549 to your computer and use it in GitHub Desktop.
kly@leia:~$ cat foo.c
#include <stdio.h>
int main(void) {
float f = 340282346638528859811704183484516925440.000000;
float x = f + 199999999999999999999.9F;
printf ("%f vs %f (%s)\n",f,x, (f==x) ? "match" : "no match");
return 0;
}
kly@leia:~$ gcc -Wall -g foo.c
kly@leia:~$ ./a.out
340282346638528859811704183484516925440.000000 vs 340282346638528859811704183484516925440.000000 (match)
kly@leia:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment