PC Review


Reply
Thread Tools Rate Thread

C# definition for NAN (in Reflector) is not correct?

 
 
josephbubba@hotmail.com
Guest
Posts: n/a
 
      18th Jun 2008
Greetings,

Question about how the NaN constant is defined in .NET.

When I look at the C# definition for the System.Double NaN definition
in Roeder's Reflector, it looks like this:

public const double NaN = (double) 1.0 / (double) 0.0;

However, according to the .NET documentation (and the IEEE standard),
the actual definition is the result of dividing zero by zero (0/0).
Dividing 1/0 is positive infinity.

Interestingly, when I switch to the any other decompilation languages
(ex. Visual Basic, or Managed C++), the value of NaN is not
specifically defined as a division, but instead uses a constant. For
example, Visual Basic looks like this:

Public Const NaN As Double = NaN



Is this simply a bug in Reflector for C#, or am I missing something?

Thanks in advance.

By the way, I'm using Reflector version 5.1.2.0 and pointing to
the .Net framework version 2.0.50727.1433.


 
Reply With Quote
 
 
 
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      18th Jun 2008
(E-Mail Removed) <(E-Mail Removed)> wrote:
> Is this simply a bug in Reflector for C#, or am I missing something?


Looks like a reflector bug to me.

--
Jon Skeet - <(E-Mail Removed)>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reflector =?Utf-8?B?Q2l0aXplbnMgaW4gdGhlIHdvcmxk?= Microsoft Dot NET Framework 1 5th Apr 2007 04:01 PM
Reflector not running under correct framework version TomC Microsoft Dot NET Framework 4 19th Dec 2006 07:17 PM
reflector HAKAN OTAL Microsoft Dot NET Framework 2 15th Feb 2005 12:52 PM
IShellFolder - last time - no hair left. Is this interface definition correct? Robin Tucker Microsoft VB .NET 1 9th Feb 2004 06:03 PM
Reflector for CF Brian Microsoft Dot NET Compact Framework 0 12th Jan 2004 03:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:30 AM.