Not a Number

An old irrational logic guided the IEEE-754 committee

3f46dbc

 

Just for fun, let’s prove that C# equality works for Tuples and (Not, aNumber) equality is reflexive.

 

            Func<bool, bool> not = x => !x;
            var a = new Tuple<Func<bool,bool>, Type>(not, typeof(double));
            var b = new Tuple<Func<bool, bool>, Type>(not, typeof(double));
            Console.WriteLine(a.Equals(b)); //True
            Console.WriteLine(double.NaN.Equals(double.NaN)); //True
            Console.WriteLine(double.NaN == double.NaN); //False
Advertisements

One thought on “Not a Number

  1. “Not a Number” was the name of the company launched by Ton Roosendaal, the cofounder of NeoGeo, where the 3D software, Blender, was born. Facing the competition of commercial programs, like Maya of Autodesk, it was thanks to a crowdfunding campaign that Blender started to be a successful open source technology, used even in Hollywood’s movies!)

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s