单声道C#十进制分割的精度是不同的?

decimal d1 = 4.0m; decimal d2 = 40.0m; decimal d = d1 / d2; string repr = d.ToString(); 

在Windows上,我为repr获得“0.1”。 在Mono(Xamarin Android)上,我获得了“0.1000000000000000000000000000”左右。 是什么赋予了? 此外,我已经看到建议除以1.0000000000000000000000000000m以摆脱不必要的尾随零。 这在Xamarin Android上都不起作用。

已知错误? 或者技术上不是错误 – 这是否符合标准?

为了摆脱零,我将值转换为字符串,从字符串中删除尾随零,并将其转换回小数。 它很弱。 此外,我的解决方案不会产生我想要的确切结果。 我宁愿留下相当重要的尾随零,而不是删除所有尾随零。

也许值得注意的是,这个错误已得到修复,正如Miguel de Icaza所述: https ://bugzilla.novell.com/show_bug.cgi ? id = 655780#c2