how do I make a portable isnan/isinf function(如何制作可移植的 isnan/isinf 函数)
问题描述
我一直在 Linux 平台上使用 isinf、
>isnan
函数,效果很好.但这在 OS-X 上不起作用,所以我决定使用 std::isinf
std::isnan
,它适用于 Linux 和 OS-X.
但英特尔编译器无法识别它,根据 http://software.intel.com/en-us/forums/showthread.php?t=64188
所以现在我只想避免麻烦并定义我自己的isinf
、isnan
实现.
有谁知道如何做到这一点?
为了使 isinf
/isnan
工作
你也可以使用 boost 来完成这个任务:
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::isinf
std::isnan
which works on both Linux and OS-X.
But the Intel compiler doesn't recognize it, and I guess its a bug in the intel compiler according to http://software.intel.com/en-us/forums/showthread.php?t=64188
So now I just want to avoid the hassle and define my own isinf
, isnan
implementation.
Does anyone know how this could be done?
edit:
I ended up doing this in my source code for making isinf
/isnan
working
You could also use boost for this task:
这篇关于如何制作可移植的 isnan/isinf 函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!