Please any one give Explanation [Resolved]

Posted by Gow.Net under C# on 3/10/2012 | Points: 10 | Views : 1077 | Status : [Member] | Replies : 7
i try the below coding
 Double zero = 0;
Console.WriteLine("The result of division by Zero in c# is:{0}", (0 / zero));

i get output for
The result of division by Zero in c# is:NaN
what is the meaning for NAN

gowthaman8870226416


Responses

Posted by: Vuyiswamb on: 3/10/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 50

Up
0
Down

Resolved

NAN = Not a Number

Thank you for posting at Dotnetfunda
[Administrator]

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 3/12/2012 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
Represents a value that is not a number (NaN). This field is constant.

Regards,
Susan

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shubham on: 3/10/2012 [Member] Starter | Points: 25

Up
0
Down
C#. C++. public static double ToDouble( string value ) ... value is not a number in a valid format thank you

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 3/12/2012 [Member] Silver | Points: 25

Up
0
Down
NaN(Nota a Number) is retured when an operation is undefined.
Here the result of the operation(You are trying to divide zero by zero) is undefined.
That's why the output as NaN.

Please refer MSDN for more details
Double.NaN Field http://msdn.microsoft.com/en-us/library/system.double.nan.aspx

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 3/12/2012 [Member] Bronze | Points: 25

Up
0
Down
NaN stands for Not a Number.

When you divide any number with zero (0), resultant value would be infinite, for .Net it terms as NaN



Mark this as answer, if it helps you...........

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/12/2012 [Member] Silver | Points: 25

Up
0
Down
The result is not a number.

Thanks,
Sanjay

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gow.Net on: 3/13/2012 [Member] Starter | Points: 25

Up
0
Down
thank u sir

gowthaman8870226416

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response