.net - C# issue with double number -
this question has answer here:
i have strange issue using double numbers in c# . net here test:
double my_value = 0.49;
the problem variable value shown instead 0.48999999999999999 not need display 0.49 using math.round()
function; need store value.
thank you.
welcome floating point precision. use decimal
type if want more precision.
decimal my_value = 0.49m;
if want learn more on why recommend read article - what every computer scientist should know floating-point arithmetic
Comments
Post a Comment