Sign in Join
Wiki copytemporary

NaN: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: NaN

OldNewLine
1+`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.
2+
3+``` pascal
4+program NotANumber(input, output, stderr);
5+begin
6+ // writes 'Nan' (with spacing) on its own line
7+ writeLn(0/0);
8+end.
9+```
10+
11+Note, `NaN` exists only in the context of floating point number calculations: `0 div 0` ([[Div|integer division]]) is not allowed, though.
12+
13+## See also
14+
15+- [Value “is not a number”](https://www.freepascal.org/docs-html/rtl/math/nan.html)
16+- [`IsNan`](https://www.freepascal.org/docs-html/rtl/math/isnan.html) checks whether value is “not a number”.
17+- [[TAChart documentation|TAChart documentation, § “skipping source items”]]
18+
19+---
20+*From the Free Pascal wiki, page "NaN", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history