davidchardonnet
Programmer
Hello,
I have a problem with Visual C++ compiler. The problem is in data conversion between LONG INT and DOUBLE. And the same occurs with INT and DOUBLE. Does anybody know how I can make it work? Here is the sample code:
-----------------------------------------------------------
double time_double_miliseconds;
double time_double_seconds;
long time_long_seconds;
...
// Here time_double_miliseconds contains 14.400000
time_double_seconds=(1000.0 * time_double_miliseconds);
// Here time_double_seconds contains 14400.00000
time_long_seconds = time_double_seconds;
// Here time_long_seconds contains 14399 !!!!!
-----------------------------------------------------------
What I want is to get 14400 into time_long_seconds. And I don't know why the compiler does this.
Thank you for your answers
David CHARDONNET
I have a problem with Visual C++ compiler. The problem is in data conversion between LONG INT and DOUBLE. And the same occurs with INT and DOUBLE. Does anybody know how I can make it work? Here is the sample code:
-----------------------------------------------------------
double time_double_miliseconds;
double time_double_seconds;
long time_long_seconds;
...
// Here time_double_miliseconds contains 14.400000
time_double_seconds=(1000.0 * time_double_miliseconds);
// Here time_double_seconds contains 14400.00000
time_long_seconds = time_double_seconds;
// Here time_long_seconds contains 14399 !!!!!
-----------------------------------------------------------
What I want is to get 14400 into time_long_seconds. And I don't know why the compiler does this.
Thank you for your answers
David CHARDONNET