Skip to content

Instantly share code, notes, and snippets.

@damp11113
Created October 11, 2023 11:15
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 damp11113/db5fba9eb901bbc8f411c77c85b91b59 to your computer and use it in GitHub Desktop.
Save damp11113/db5fba9eb901bbc8f411c77c85b91b59 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
float epsilon = 1;
float one = 1;
while (1 + epsilon != 1) {
printf("Epsilon = %.12f\n", epsilon);
epsilon/=2;
}
printf("Epsilon = %.12f\n", epsilon);
if (1+epsilon == 1) {
printf("yes\n");
} else {
printf("no\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment