I have a function which takes 3 double values, none of that from an array or casted integers or some like that, are 3 double values which are calculated before calling this function. Then, the function is expected to return a double value and does... but one of the terms is considered as an integer, specifically (5/3) = 1.0 What I did is to replace (5/3) with 1.6667 Why is this happening? Any idea? Here is the code :
private static double get_fa(double cc, double R, double fy)
{
double num, den, fa;
if (cc<=200)
{
if (R <= cc)
{
num = (1 - (Math.Pow(R, 2) / (2 * Math.Pow(cc, 2)))) * fy;
den = (5/3) + (3 * R) / (8 * cc) - Math.Pow(R, 3) / (8 * Math.Pow(cc, 3));
fa = num / den;
}
else
{
fa = (12 * Math.Pow(Math.PI, 2) * E) / (23 * Math.Pow(R, 2));
}
return fa;
}
else
{
return 0;
}
}