特殊值 !Values
跳到导航
跳到搜索
- NAN and Infinity value
IDL> help,!Values,/str ** Structure !VALUES, 4 tags, length=24, data length=24: F_INFINITY FLOAT Inf F_NAN FLOAT NaN D_INFINITY DOUBLE Infinity D_NAN DOUBLE NaN Inf还可取负 IDL> print,-1*!Values.F_INFINITY -Inf 问题:如何给一个整数变量赋一个NAN 或者 INFINITY
- F_INFINITY可以和浮点数做比较 F_NAN不能
B = [1.0, 2.0, !VALUES.F_NAN] IDL> PRINT, WHERE(B EQ !VALUES.F_NAN -1
- 在求平均等计算时,设置/NAN开关,可将这些数忽略
IDL> print,mean(B) NaN IDL> print,mean(B,/NAN) 1.50000