lesson 5 precise c
[[lesson_5_precise_c]] last edit on Aug 8, 2005 4:37 AM by rescued_by_c

[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]$