exp() precision between Mac OS and Windows

后端 未结 1 673
终归单人心
终归单人心 2021-01-25 05:54

I got a code here, and when I run them on Win and Mac OS, the precision of the results is different, anyone can help?

const         


        
1条回答
  •  隐瞒了意图╮
    2021-01-25 06:18

    How Can I get the same result.

    Unless the math library on OS X uses the very same implementation/algorithm for calculating e ^ x, you won't and can't really get exactly the same results. Floating-point calculations aren't exact, deal with it.

    0 讨论(0)
提交回复
热议问题