Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

NaN

English · Suomi · Русский

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.

pascal
program NotANumber(input, output, stderr);
begin
    // writes 'Nan' (with spacing) on its own line
    writeLn(0/0);
end.

Note, NaN exists only in the context of floating point number calculations: 0 div 0 (integer division) is not allowed, though.

See also


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.

Revision 1, last changed by WikiArchive .