Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created August 24, 2016 12:04
Show Gist options
  • Save KristianLyng/2a85e8b79aceedfe583e4686e7b47b44 to your computer and use it in GitHub Desktop.
Save KristianLyng/2a85e8b79aceedfe583e4686e7b47b44 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 * 2;
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 inf (no match)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment