Did u feel its a best way to use double in your application.
Test the following scenario:
double a=0.3;
double b=0.1+0.1+0.1;(or)0.2+0.1;
if(a==b)
MessageBox.Show(r u great?);
else
MessageBox.Show(u r great!);
if u put float u wont get the same output.
There is not only problem in using this format. but there are lot of issues and doubt while using double datatype. So consider twice before using double in your application
Solution: We cant say it as an error. in Java also the same thing will happen. its some double precision format.
Better using decimal is a good solution.
Effect of Double in .net
Posted by
Nirmal
Thursday, October 23, 2008
0 comments:
Post a Comment