Created
August 30, 2012 20:15
-
-
Save khakimov/3539792 to your computer and use it in GitHub Desktop.
Rocket science
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 <stdio.h> | |
double recip(int denom) | |
{ | |
return 1.0/(double) denom; | |
} | |
void do_nothing() {} | |
int main(int argc, char const *argv[]) | |
{ | |
double r1, r2; | |
int t1, t2; | |
int denom = 10; | |
r1 = recip(denom); | |
r2 = recip(denom); | |
t1 = r1 == r2; | |
do_nothing(); | |
t2 = r1 == r2; | |
printf("test1 t1: r1 %f %c= r2 %f\n", r1, t1 ? '=' : '!', r2); | |
printf("test2 t2: r1 %f %c= r2 %f\n", r1, t2 ? '=' : '!', r2); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment