comprehensible modulo calculation
This question already has an answer here:
This is due to floating point errors, you should look for low absolute differences instead of exact matches. It is not 0.6, but (just an example) 0.6000000003 or 0.5999999997. Try something like:
ifelse((abs((d*10) %% 2)<0.000001), d, NA)
链接地址: http://www.djcxy.com/p/58298.html
上一篇: ASP.NET MVC 404错误处理
下一篇: 可理解的模数计算