K
Kubik
Hi!
Let's see, we got:
float var=4.6f; //as we know 414/4.6 shoud be equal to 90
but Math.Ceiling(414/var) gives us 91
but (414/var).ToString() prints '90'.
And when we convert:
((double)(414/var)).ToString() we got '90,0000018658846'
I know how the floats are represented in memory and I know
limitations connected with, but why compiler and program
makes bugs in such simple cases??
Adam
Let's see, we got:
float var=4.6f; //as we know 414/4.6 shoud be equal to 90
but Math.Ceiling(414/var) gives us 91
but (414/var).ToString() prints '90'.
And when we convert:
((double)(414/var)).ToString() we got '90,0000018658846'
I know how the floats are represented in memory and I know
limitations connected with, but why compiler and program
makes bugs in such simple cases??
Adam