2
I have a method that returns a float (but I can change this return to the other if I need to)
float mmc(int a, int b)
{
float num1, num2, x, y, mmc = 0;
num1 = a;
num2 =b;
x = num1;
y = num2;
while (num1 != num2)
{
if (num1 > num2)
{
num1 = num1 - num2;
}
else
{
num2 = num2 - num1;
}
}
float resultado =(x * y) / num1;
mmc = (x * y) / num1;
return mmc;
}
When passing high values (which will always occur) it returns letters and numbers. The formula is right, in Excel is beating, but there I format the cell to number and then I get the correct result.
example
mmc returned result = 2.22292E+12 and how I need 2222921601281.
How do I convert or treat this value to c# ?
the value hit, I appreciate the help @Natan Fernandes
– Danielle Arruda torres
Thank you for!
– Natan Fernandes