undefined

When you give a query command for a numeric value, Praat sometimes writes the numeric value --undefined-- into the Info window (two hyphens at both sides of the word). This happens if the value you ask for is not defined, as in the following examples:

Usage in a script

In a Praat script, this value is simply represented as "undefined". You use it to test whether a query command returned a valid number:

selectObject: "Pitch hallo"
meanPitch = Get mean: 0.1, 0.2, "Hertz", "Parabolic"
if meanPitch = undefined
    # Take some exceptional action.
else
    # Take the normal action.
endif

Details for hackers

In text files, this value is written as --undefined--. In binary files, it is written as a big-endian IEEE positive infinity. In memory, it is usually a specific "not-a-number" (NaN), namely the result of dividing 0 by 0, although other NaNs, and also infinities, will equally be reported as --undefined--.

Links to this page


© ppgb, September 10, 2017