long arithmetic in C

48 Views Asked by At

can you divide two long datatypes and turn them into a fraction? If not, would you have to type convert the datatypes into floats? Can someone explain how long arithmetic works in C.

This is a snippet of my code, the datatypes of denominator and numerator are long.

float sum=0;
for (i=0; i < num+1 ; i++) {
    denominator = factorial(i);
    printf("%ld\n",denominator);
    sum+=(numerator/denominator);
    printf("\n%f\n",sum);
}
0

There are 0 best solutions below