I expect it to return one! :laugh:
Why? Simples:
53 and 32 are integers. so 53 / 32 is also an integer, value 1.
The
double
cast of an integer value will not restore lost fractional data...
Try:
int rndx = (int)Math.Round(((decimal)53 / (decimal)32), 0, MidpointRounding.AwayFromZero);
Or
int rndx = (int)Math.Round((53M / 32M), 0, MidpointRounding.AwayFromZero);
Which specifies decimal constants.
[edit]Fingers-typing-ahead-of-brain disease. "double" for "decimal" :doh: - OriginalGriff[/edit]