[user02@FC4 Lesson05]$ cat -n precise.c
1 #include <stdio.h>
2
3 int main(void)
4 {
5 float f_not_half = 0.49999990;
6 double d_not_half = 0.49999990;
7
8 printf("Floating point 0.49999990 is %f\n", f_not_half);
9 printf("Double 0.49999990 is %f\n", d_not_half);
10
11 return 0;
12 }
[user02@FC4 Lesson05]$ gcc -o precise precise.c[user02@FC4 Lesson05]$ ./precise
Floating point 0.49999990 is 0.500000
Double 0.49999990 is 0.500000
[user02@FC4 Lesson05]$
lesson_5_precise.c, Rev. 1, Last changed on 2005-08-08 04:37, 303 page hits