Undefined values: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
imported>Fth
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(One intermediate revision by one other user not shown)
Line 363:
 
=={{header|Forth}}==
Forth does not have undefined values, but defined and undefined wordsvariables can be checked.
<syntaxhighlight lang="forth">
[undefined] var [if] .( var is undefined at first check) cr [then]
Line 383:
var is undefined at third check
</pre>
 
=={{header|Fortran}}==
Older style Fortran had no inbuilt facilities, other than a programmer adding code to recognise certain special values as "no value" or similar, so a set of valid values might be 1:20, and zero was reserved to signify "bad", or for a three-digit data field the special value 999 might be recognised, etc. Mistakes and confusions were routine, since a six-digit field might require 999999 except that value is too big for sixteen-bit integers and as a floating-point value may not be exactly expressed in binary. Averaging such values without checking for 999 (or 999999, etc.) might lead to overflow in output data fields or bad results that might be detected before publishing a report. In ''Numerical Methods That Work - Usually'', F.S. Acton remarks "The person who encoded YES, NO, DON'T CARE as one, two, three, ''respectively'' got the sort of correlations she deserved."
Line 1,526 ⟶ 1,527:
 
In conditional expressions, ''null'' as well as the Boolean value ''false'' are considered to be 'false'. All other values (including zero) are considered to be 'true'.
<syntaxhighlight lang="ecmascriptwren">var f = Fn.new {
System.print("'f' called.") // note no return value
}
9,476

edits