<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=How_to_detect_NaN</id>
	<title>How to detect NaN - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=How_to_detect_NaN"/>
	<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=How_to_detect_NaN&amp;action=history"/>
	<updated>2026-04-09T14:55:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>http://miniscript.org/w/index.php?title=How_to_detect_NaN&amp;diff=128&amp;oldid=prev</id>
		<title>JoeStrout: Created page with &quot;Invalid math operations may result in a numeric value of NaN (&quot;Not a Number&quot;).  These values have special semantics: they are not considered equal to anything, even themselves...&quot;</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=How_to_detect_NaN&amp;diff=128&amp;oldid=prev"/>
		<updated>2020-03-11T22:13:30Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Invalid math operations may result in a numeric value of NaN (&amp;quot;Not a Number&amp;quot;).  These values have special semantics: they are not considered equal to anything, even themselves...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Invalid math operations may result in a numeric value of NaN (&amp;quot;Not a Number&amp;quot;).  These values have special semantics: they are not considered equal to anything, even themselves.  In fact NaN is the ''only'' value in MiniScript not equal to itself.&lt;br /&gt;
&lt;br /&gt;
So if you need to find out whether a numeric value is NaN, just check whether it does not equal itself.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;ms&amp;gt;x = 0/0&lt;br /&gt;
print x       // prints &amp;quot;nan&amp;quot; or &amp;quot;NaN&amp;quot;, depending on the host platform&lt;br /&gt;
print x != x  // prints 1 (true)&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This could of course be wrapped up in a convenience function as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;isNan = function(x)&lt;br /&gt;
    return x != x&lt;br /&gt;
end function&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:How To]]&lt;/div&gt;</summary>
		<author><name>JoeStrout</name></author>
		
	</entry>
</feed>