Skip to content

Instantly share code, notes, and snippets.

@doi-t
Created June 21, 2014 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doi-t/2e01219033aeef479920 to your computer and use it in GitHub Desktop.
Save doi-t/2e01219033aeef479920 to your computer and use it in GitHub Desktop.
0.1 + 0.1 + 0.1 == 0.3 ?
#include <stdio.h>
int
main(void)
{
double answer = 0.1 + 0.1 + 0.1;
if(answer == 0.3){
printf("True:%.100f\n", answer);
} else {
printf("False:%.100f\n", answer);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment