[comp.sys.atari.st] float <----> double??!@##@*@! GCC137

bud@ms.uky.edu (William K. Glunt --- green eyed devil) (08/04/90)

Hi guys,
 I'm installing Gnu C on my ST,  and I've run into something a little
odd.  Consider the following :

#include <stdio.h>
main(){
int i ;
double f,s ;
s = 0 ;
for ( i = 1 ; i <=10000 ; ++i )
{
 f = i ;
 s = s + 1/(f*f) ;
 }
 printf("%f\n",s) ;
 }


When I compile this with 'gcc junk.c -o junk.ttp',
I get what I expect,  about 1.644933.  But if I change the
'double' to 'float',  I get 0.00000.  Now I'm an utter novice
when it comes to C,  so it's quite possible I've just done
something goofy.  Any ideas?
  Thanks!

  Bud


-- 
William K Glunt         | Are you ABNORMAL?
U of Kentucky Math Dept.| Then you are probably better than most people!
 606 258 8864           | Are alien space monsters bringing a STARTLING NEW
			| WORLD?  from _The book of the SubGenius_