Search code examples
unicodecharacternan

Is there a single Unicode character representation of the value NaN?


I couldn't find anything on Google. I thought I had seen it before.


Solution

  • No. NaN is not a character-level concept but a concept in floating-point formats and in many programming languages.

    In some contexts, the symbol “�” has been used to denote NaN, but this is just an odd convention and does not correspond to the Unicode meaning of “�”, U+FFFD REPLACEMENT CHARACTER, which is (by the Unicode Standard) “used to replace an incoming character whose value is unknown or unrepresentable in Unicode”.

    Due to the influence of such misguided notations, in some early versions of Common Locale Data Repository (CLDR), “�” was the default (root) localization for the NaN concept. But this has been fixed long ago; the default localizations is now the three-letter string “NaN” (and it seems that currently only Arabic has a localization that differs from the default).