futzing with a tricky float increment
This commit is contained in:
parent
9ab4fa7279
commit
3c51da2e98
26
gowrikumar/src/08-incrfloat.c
Normal file
26
gowrikumar/src/08-incrfloat.c
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* :author: Dan Buch (daniel.buch@gmail.com)
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
float f = 0.0f;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
f = f + 0.1f;
|
||||
}
|
||||
|
||||
if (f == 1.0f) {
|
||||
printf("f is 1.0 \n");
|
||||
} else {
|
||||
printf("f is NOT 1.0\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* vim:filetype=c:fileencoding=utf-8
|
||||
*/
|
Loading…
Reference in New Issue
Block a user