Last active
June 10, 2020 01:14
-
-
Save cosinekitty/1d482ea4fea7a039275afdf0ca4593c7 to your computer and use it in GitHub Desktop.
Revisions
-
cosinekitty revised this gist
Jun 10, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,9 +11,10 @@ int main() { double r = Distance(3.0, 4.0); double diff = fabs(r - 5.0); printf("diff = %lf\n", diff); if (diff > 1.0e-12) { printf("FAIL\n"); return 1; } printf("PASS\n"); -
cosinekitty created this gist
Jun 10, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #include <stdio.h> #include <math.h> double Distance(double x, double y) { /* Intentional bug for illustration... */ return sqrt(-1.0); } int main() { double r = Distance(3.0, 4.0); double diff = fabs(r - 5.0); if (diff > 1.0e-12) { printf("FAIL: diff = %lf\n", diff); return 1; } printf("PASS\n"); return 0; }