Re: NaN in pv-wave [message #14379] |
Thu, 25 February 1999 00:00 |
Dr. Dirk Engelbart
Messages: 2 Registered: February 1999
|
Junior Member |
|
|
jlh wrote:
>
> Hi,
>
> In IDL the expression for NaN (Not a Number ) is :
> !values.f_nan. Does anyone know if there is an equivalent expression
> in pvwave ?
>
> Thanks,
>
> Jacob
Jacob,
Trying to do various translation tasks between WAVE and IDL, I
recently had the same question as you. The answer is simple as you will
see below. You simply need to have the IMSL mathematics package being
standard in PV-WAVE Advantage. This package includes the function
MACHINE() which can be used as follows:
values = MACHINE(/Float)
; Get the single-precision, floating-point machine constants. This call
supplies a ;structure whose elements might be inspected ba calling
values using the /STRUCTURE keyword. One of the elements of values will
then be "values.nan"!
info,values,/STRUCTURE
; As an example for the data assignment of variables look at the
following line which assigns a 3-element vector "a" using the intended
"NaN" as well as additionally negative-infinite values.
a = [values.nan,3.0,values.neg_inf]
This means in PV-WAVE you can use exactly the same function as in IDL
"!values.f_nan" by calling the function "values.nan".
That's it.
Regards,
DIRK.
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Dirk Engelbart
DWD - Observat.Lindenberg
engelbart@mol.dwd.d400.de
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
|
|