H
Homer Simpson
Hi everyone,
I wrote a quick method to perform a calculation to determine the average of
two numbers. When 23 and 40 were used, the result was 31, not 31.5! I
discovered the problem, I was using long data types, not double. So, how
does c# and/or .NET round numbers? Does is just truncate the value? If
rounded, I think 31.5 should have been rounded to 32.
Thanks,
Scott
I wrote a quick method to perform a calculation to determine the average of
two numbers. When 23 and 40 were used, the result was 31, not 31.5! I
discovered the problem, I was using long data types, not double. So, how
does c# and/or .NET round numbers? Does is just truncate the value? If
rounded, I think 31.5 should have been rounded to 32.
Thanks,
Scott