Undefined values: Difference between revisions

imported>Fth
imported>Fth
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."
Anonymous user