;+ ; NAME: ; BadValue ; PURPOSE: ; Provide the Not A Number value for any data type ; CATEGORY: ; sat/idl/toolbox ; CALLING SEQUENCE: FUNCTION BadValue, X ; INPUTS: ; X variable of any type ; OUTPUTS: ; Result scalar; type: as implied by 'size' vector ; NaN value ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; IsType ; PROCEDURE: ; For integers the number zero is returned. ; For floating point the appropriate value from !values is returned. ; MODIFICATION HISTORY: ; MAR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- CASE IsType(X) OF IsType(/byte_x): NaN = 0B IsType(/short ): NaN = 0 IsType(/long ): NaN = 0L IsType(/float ): NaN = !values.f_nan IsType(/double): NaN = !values.d_nan ELSE: NaN = 0 ENDCASE RETURN, NaN & END