Difference between revisions of "NaN"
From Lazarus wiki
Jump to navigationJump to searchm (syntaxhighlight) |
m (ordinal numbers in syntaxhighlight) |
||
Line 5: | Line 5: | ||
<syntaxhighlight lang="pascal" enclose="none">NaN</syntaxhighlight> is not the same as infinity. | <syntaxhighlight lang="pascal" enclose="none">NaN</syntaxhighlight> is not the same as infinity. | ||
− | <syntaxhighlight lang="pascal" line | + | <syntaxhighlight lang="pascal" line highlight="3-4"> |
program NotANumber(input, output, stderr); | program NotANumber(input, output, stderr); | ||
begin | begin |
Revision as of 16:23, 30 April 2018
│
English (en) │
suomi (fi) │
русский (ru) │
NaN
(not a number) is a numeric data type value representing an undefined or unrepresentable value.
These values result from operations which have undefined numerical results.
NaN
is not the same as infinity.
1program NotANumber(input, output, stderr);
2begin
3 // writes 'Nan' (with spacing) on its own line
4 writeLn(0/0);
5end.
Note, NaN
exists only in the context of floating point number calculations:
0 div 0
(integer division) is not allowed, though.
See also
- Value “is not a number”
IsNan
checks whether value is “not a number”.TAChart
documentation, § “skipping source items”