>Hi Fabio
>
>I did run the code, what really happens. I browsed and I see a 3.0. I guess I am slow to understand, please tell me the reasons.
Double-precision numbers are stored internally in a binary format, and with the format of a number in scientific notation; one bit for the sign, so many bits for the exponent (base 2), so many bits for the mantissa (base 2). There are 15 significant digits, but there can be some rounding errors in the last digits.
>And is double advisable to use?
I have no personal experience with this, but I believe the rounding errors will cause you trouble, but only occasionaly.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)