In general, c# floating points have following precisions:
- float - 7 digits
- double - 15-16 digits
- decimal - 28-29 digits
See below example:
Output of that example is as follows:
As you can see output output of conditions for float and double values is True. It is because float has 7 digits precision and our float1 value is equal 1 in relation to 7 digits of precision. The same situation is for double value in terms of 15 digits precision.
0 comments:
Post a Comment