During the undergraduate studying process, students are familiar with the representation of integers and fractional numbers inside the machine. As a result, this chapter may be kind of basic. However, some interesting facts do exists, which I never think about before.
For instance, we all know that when computing with
float data, all the data will be cast to float to make sure the loss of data being deduced. To get a result of 0.4, use
int a = 2;
int b = 5;
double f = (a + 0.0) / b
to make the cast.