Follow-up Comment #2, patch #4819 (project freeciv):

I checked it several ways, confirming both in-game and with various language
references.  I also wrote a simple test program to confirm syntax (although
I've deleted it).  From memory:


#include <stdio.h>
int main (void) {
  int i, q;
  for(i=0;i++;i<37){
    q=(int)(i*1.41421356f);
    printf("i:%d, q:%d\n",i,q);
  }
  return 0;
}


    My understanding is that multiplication of an integer and a float results
in a double, regardless of the order of the operands (see 7.3.1 in
http://cm.bell-labs.com/who/dmr/cman.pdf).  That said, modern C may have
adjusted this at some point (I've not been following the new standards
closely), but this form works with my compiler.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?4819>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to