English

Undefined value

In computing (particularly, in programming), undefined value is a condition where an expression does not have a correct value, although it is syntactically correct. An undefined value must not be confused with empty string, boolean 'false' or other 'empty' (but defined) values. Depending on circumstances, evaluation to an undefined value may lead to exception or undefined behaviour, but in some programming languages undefined values can occur during a normal, predictable course of program execution. In computing (particularly, in programming), undefined value is a condition where an expression does not have a correct value, although it is syntactically correct. An undefined value must not be confused with empty string, boolean 'false' or other 'empty' (but defined) values. Depending on circumstances, evaluation to an undefined value may lead to exception or undefined behaviour, but in some programming languages undefined values can occur during a normal, predictable course of program execution. Dynamically typed languages usually treat undefined values explicitly when possible. For instance, Perl has undef operator which can 'assign' such value to a variable. In other type systems an undefined value can mean an unknown, unpredictable value, or merely a program failure on attempt of its evaluation. Nullable types offer an intermediate approach; see below. The value of a partial function is undefined when its argument is out of its domain of definition. This include numerous arithmetical cases such as division by zero, square root or logarithm of a negative number etc.; see NaN. Even some mathematically well-defined expressions like exp(100000) may be undefined in floating point arithmetic because the result is so large that it cannot be represented. If an implementation supports ±∞, then this value may be computed as +∞ (inf), however. An element of an array is undefined when its index is out of bounds, as is the value in an associative array for a key which it does not contain. An argument of a variadic function which was not passed to it, is undefined within the function body. A variable which is not initialized has undefined (or unpredictable) value until it is assigned. Dereferences of null pointers lead to undefined values and usually raise an exception immediately. Any expression of the bottom type is undefined by definition, because that type has no values.

[ "Algorithm", "Theoretical computer science", "Programming language", "value" ]
Parent Topic
Child Topic
    No Parent Topic