Skip to content

Instantly share code, notes, and snippets.

@tomcha
Created November 22, 2018 02:09
Show Gist options
  • Save tomcha/205e96a9ee48fb37b425ee2e2a458061 to your computer and use it in GitHub Desktop.
Save tomcha/205e96a9ee48fb37b425ee2e2a458061 to your computer and use it in GitHub Desktop.
C言語での小数計算
#include <stdio.h>
int main() {
float f = 0.0;
int j = 0;
for (int i = 0; i < 100; i++){
f += 0.01;
j += 1;
}
printf("%f\n", f);
printf("%d\n", j);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment