Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created November 19, 2011 22:02
Show Gist options
  • Select an option

  • Save KristianLyng/1379427 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/1379427 to your computer and use it in GitHub Desktop.
$ cat foo.c
#include <stdio.h>
int main() {
double a=2.6,b=2.6;
printf("a: %d b: %d a+b: %d\n",(int)a,(int)b,(int)(a+b));
return 0;
}
$ gcc foo.c
$ ./a.out
a: 2 b: 2 a+b: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment