I am new to C# and programming in general, for my assignment at university I have been asked to program a calculator and I am running into some trouble, here is my code:
private bool IsInfinity(long result)
{
if (result > Int32.MaxValue || result < Int32.MinValue)
{
errorFound = true;
return true;
}
else
{
return false;
}
}
private double Add(double number1, double number2)
{
if (IsInfinity = true)
{
errorFound = true;
return 0;
}
else
{
double result = number1 + number2;
result = Math.Round(result, 2);
return result;
}
}
I am having trouble with the line,
if (IsInfinity = true)
as it is causing an error that reads, "Cannot assign to 'IsInfinity' because it is a 'method group'", I am struggling to find a solution to this and any help would be greatly appreciated. Thanks