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:

• You select a Sound with a finishing time of 1.0 seconds and ask for the minimum point in the wave form between 1.5 and 2.0 seconds (with the query command Get minimum...).
• You ask for a pitch value in a voiceless part of the sound (select a Pitch, then choose Get value at time...).
• You type into the Calculator the following formula: 10^400.

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 20170910