Why is Math.DivRem so inefficient?

后端 未结 11 1943
慢半拍i
慢半拍i 2020-12-08 18:59

In my computer this code takes 17 seconds (1000 millions times):

static void Main(string[] args) {
   var sw = new Stopwatch(); sw.Start();
   int r;
   for          


        
11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 19:34

    The answer is probably that nobody has thought this a priority - it's good enough. The fact that this has not been fixed with any new version of the .NET Framework is an indicator of how rarely this is used - most likely, nobody has ever complained.

提交回复
热议问题