In ThinkC 6:
I'm at a loss why this isn't working - @jcs tried this in ThinkC 5 and it works. What's going on here in ThinkC 6?
C:
main()
{
unsigned long int data_size, remaning_size;
data_size = 12345;
remaning_size = 2345;
printf("%f\n", (data_size - remaning_size) / data_size);
// expected: 0.810044
// actual: 0.000000
}
/*
Tried:
casting each element to double, eg ((double)data_size - remaning_size) / data_size) - no go
adding 0.0 - (data_size + 0.0 - rem_size) / data_size // this oddly works in the debug window, but not via printf
pulling hair out
*/
I'm at a loss why this isn't working - @jcs tried this in ThinkC 5 and it works. What's going on here in ThinkC 6?