NaNNaN is the notation in LabVIEW for the floating-point value Not-a-Number. LabVIEW implements the IEEE-754 standard for floating-point calculations, which specifies unique values for the outputs of mathematical operations which have no meaningful numerical result. A few examples of calculations which produce NaN are:
division of zero by zero
square root of a negative number
division of an infinity by an infinity
logarithm (any base) of a non-positive number
any calculation which includes NaN as one of its operands
The last example above implies that any calculation sequence which generates NaN as an intermediate step will propagate NaN through all subsequent calculations. While this is generally true, there are exceptions (the LabVIEW Power of X primitive returns one for zero raised to NaN).
One salient feature of the NaN value is that all comparison operations involving NaN return FALSE, including the equality operator (in other words, NaN != NaN). LabVIEW provides the Not A Number/Path/Refnum? primitive, which is the proper way to test for NaN.
Not A Number/Path/Refnum?
primitivefile:///C:/Users/John/AppData/Local/youdao/ynote/images/9C5EAACA2A2E412DADD00BDF3B58A807/Nanfunc.pngFloating-point controls, indicators, and block diagram constants support the direct entry of NaN (case-insensitive). Similarly, string-to-numeric and numeric-to-string primitives convert or format NaN without regard to format specifiers. Use Cases
indicating "missing" data in data-tables in files.
used for lifting the "plotting pen" in graph, for instance if a value would be out of its allowed range.
试了多种方法还是不能创建带null结点的数组,能否贴个小程序呢
Sorry,我记错了,是NaN;
关于NaN的官方解释:
http://labviewwiki.org/NaN
NaNNaN is the notation in LabVIEW for the floating-point value Not-a-Number. LabVIEW implements the IEEE-754 standard for floating-point calculations, which specifies unique values for the outputs of mathematical operations which have no meaningful numerical result. A few examples of calculations which produce NaN are:
- division of zero by zero
- square root of a negative number
- division of an infinity by an infinity
- logarithm (any base) of a non-positive number
- any calculation which includes NaN as one of its operands
The last example above implies that any calculation sequence which generates NaN as an intermediate step will propagate NaN through all subsequent calculations. While this is generally true, there are exceptions (the LabVIEW Power of X primitive returns one for zero raised to NaN).One salient feature of the NaN value is that all comparison operations involving NaN return FALSE, including the equality operator (in other words, NaN != NaN). LabVIEW provides the Not A Number/Path/Refnum? primitive, which is the proper way to test for NaN.
Not A Number/Path/Refnum?
primitivefile:///C:/Users/John/AppData/Local/youdao/ynote/images/9C5EAACA2A2E412DADD00BDF3B58A807/Nanfunc.pngFloating-point controls, indicators, and block diagram constants support the direct entry of NaN (case-insensitive). Similarly, string-to-numeric and numeric-to-string primitives convert or format NaN without regard to format specifiers.
Use Cases
- indicating "missing" data in data-tables in files.
- used for lifting the "plotting pen" in graph, for instance if a value would be out of its allowed range.
External links一周热门 更多>