Try the "comp.lang.c.moderated" group for C and C library questions.
You probably meant:
if( fp != NULL )
fclose( fp );
That is, "!= NULL" rather than "== NULL".
Try strtold() perhaps. It happily reads all the formats (15892938475,
1.5892938475E10 etc) you asked for.
If the significand part of the float is as large or larger than the
int type, then you can convert the result to an int type with no loss
of precision. 80 bit long double (common on x86) has
Hi.
Instead of all the clever bit twiddling I have used code similar to
sum > UINT8_MAX
which just generates
cmp ax,255
seta al
which seems to be far more efficient (even the signed version gets optimized
down to the above single check).
Please could someone tell me if I have
Hi Folks,
GCC 4.5.1 20100924 "-Os -minline-all-stringops" on Core i7
int
main( int argc, char *argv[] )
{
int i, a[256], b[256];
for( i = 0; i < 256; ++i ) // discourage optimization
a[i] = rand();
memcpy( b, a, argc * sizeof(int) );
printf( "%d\n", b[rand()] ); // discourag