Because in the fallow code line:

Qt Code:
  1. float f = Density*100;
To copy to clipboard, switch view to plain text mode 

and

Qt Code:
  1. float f = 0.13*100;
To copy to clipboard, switch view to plain text mode 

the number "100" in implicity cast to a float and this conversion could lead to a precision lost.

Try to use:

Qt Code:
  1. float f = Density*100.0;
To copy to clipboard, switch view to plain text mode 

and

Qt Code:
  1. float f = 0.13*100.0;
To copy to clipboard, switch view to plain text mode