C
Chris
Hi,
a strange behaviour when working with exceptions :
when I divide and integer by 0 will an exception be thrown. OK
but, when I divide a double by 0 is no exception thrown ???
How come ?
Try it out.
try
{
int i=1, j=0;
int result = i / j;
// double i=1.0, j=0;
// double result = i / j;
Console::WriteLine("Result {0} / {1} = {2}", i.ToString(), j.ToString(),
result.ToString());
}
catch (Exception* pExc)
{
Console::WriteLine("Exception caught : '{0}' ", pExc->Message);
}
can anybody explain this ?
thnx
Chris
a strange behaviour when working with exceptions :
when I divide and integer by 0 will an exception be thrown. OK
but, when I divide a double by 0 is no exception thrown ???
How come ?
Try it out.
try
{
int i=1, j=0;
int result = i / j;
// double i=1.0, j=0;
// double result = i / j;
Console::WriteLine("Result {0} / {1} = {2}", i.ToString(), j.ToString(),
result.ToString());
}
catch (Exception* pExc)
{
Console::WriteLine("Exception caught : '{0}' ", pExc->Message);
}
can anybody explain this ?
thnx
Chris