博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
查找数组中的NAN IDL
阅读量:2442 次
发布时间:2019-05-10

本文共 1169 字,大约阅读时间需要 3 分钟。

The problem is that an NAN is ... well, not a number. Thus, you can't use it in expressions that require a number. (Think of it as a mathematical Catch-22, if you like.)

The proper way to write this code is like this:

IF(Finite(value) EQ 0  THEN BEGIN      Print,'Not a number'   ENDIF ELSE BEGIN      Print,'Is a number!'   ENDELSE

It is then that we all learned even simple answers aren't always so simple. Tom McGlynn immediately responded with this clarification.

That doesn't distinguish NaN from the infinities. The standard trick in any language for looking for NaN's is

if x ne x then begin      print,'This is a NaN'   endif else ...

This can get optimized away if the compiler/interpreter is poorly designed. NaN's are not equal to anything --- even themselves.

To which Ken Bowman, who wisely was keeping his eye on the documentation, replied.

The FINITE function has three keywords: NANINFINITY, and SIGN to distinguish between NaNsInfs, and to return the signs of arguments.

Note that you can only use NaNs in floating point (!Values.F_NaN) and double precision (!Values.D_NaN) arrays. There is no NaN bit pattern for byte, integer, or long data types.

转载地址:http://otiqb.baihongyu.com/

你可能感兴趣的文章
go函数的可变长参数_如何在Go中使用可变参数函数
查看>>
debian 服务器_使用Debian 10进行初始服务器设置
查看>>
joi 参数验证_使用Joi进行节点API架构验证
查看>>
react-notifications-component,一个强大的React Notifications库
查看>>
如何在Debian 10上设置SSH密钥
查看>>
如何在Debian 10上安装Node.js
查看>>
angular4前后端分离_如何在Angular 4+中使用Apollo客户端GraphQL
查看>>
如何在Ubuntu 18.04上安装Apache Kafka
查看>>
如何在Ubuntu 20.04上安装R [快速入门]
查看>>
debian tomcat_如何在Debian 10上安装Apache Tomcat 9
查看>>
如何为Python 3设置Jupyter Notebook
查看>>
docker 容器共享数据_如何在Docker容器之间共享数据
查看>>
express中间件_创建自己的Express.js中间件
查看>>
如何在Ubuntu 18.04上使用Docker和Caddy远程访问GUI应用程序
查看>>
Apache配置错误AH00558:无法可靠地确定服务器的标准域名
查看>>
apache 证书配置_Apache配置错误AH02572:无法配置至少一个证书和密钥
查看>>
web设置字体粗细css_Web上使用CSS的可变字体
查看>>
css 垂直对齐_CSS垂直对齐属性
查看>>
为您的网站提供动力的100种Jamstack工具,API和服务
查看>>
api restful_构建RESTful API的13种最佳实践
查看>>