J
Joe
Hi all,
I have a linux c source code that stores a float value into a type int on
many occasions. Is this possible in linux or
does compiler round the float value into integral type? The strange thing is
that calculations have to be precise in this matter of code. Unfortunately i
dont have the linux compiler to test any of the code. Microsoft and Borland
compilers warn that loss of data will occour. I know linux is full of
surprises though.
Like:
int a = 0.1;
int b = 0.1;
int c = a +b; //is c 0 or 0.2 ?
Thanks for your answers, Joe
I have a linux c source code that stores a float value into a type int on
many occasions. Is this possible in linux or
does compiler round the float value into integral type? The strange thing is
that calculations have to be precise in this matter of code. Unfortunately i
dont have the linux compiler to test any of the code. Microsoft and Borland
compilers warn that loss of data will occour. I know linux is full of
surprises though.
Like:
int a = 0.1;
int b = 0.1;
int c = a +b; //is c 0 or 0.2 ?
Thanks for your answers, Joe