-1

Why I convert

string str=0,0001234567890;
float f=float.Parse(str);

f = 0,0001234568 ? I know that float have 7 significant figures but why last digit =8 no 7?

T.Tomilos
  • 11
  • 2
  • 1
    Possible duplicate of [floating precision lost in float.Parse](https://stackoverflow.com/questions/28300887/floating-precision-lost-in-float-parse) – Charlie Jan 28 '18 at 14:42
  • _"why last digit =8 no 7?"_ -- how about you explain to us why you think it should be 7. Because, in the world of normal math, we round rather than truncate when reducing the number of digits. Why do you think the displayed value should be truncated instead of rounded? – Peter Duniho Jan 28 '18 at 22:36

1 Answers1

0

f = 0,0001234568 this number round figure by 7 digit.

soheshdoshi
  • 594
  • 3
  • 7
  • 24