how do I make a portable isnan/isinf function

前端 未结 11 1490
遇见更好的自我
遇见更好的自我 2020-11-29 06:02

I\'ve been using isinf, isnan functions on Linux platforms which worked perfectly. But this didn\'t work on OS-X, so I decided to use std::is

11条回答
  •  Happy的楠姐
    2020-11-29 06:31

    You could also use boost for this task:

    #include  // isnan
    
    if( boost::math::isnan( ... ) .... )
    

提交回复
热议问题