if all the variables at first are integer isn't integer multiplication supposed to be exact ?
Even though i am getting very large numbers(as long as not overflow): anyway at the end i will have to divide a floating point number by the integer(s). There are several steps and at first i just divided the floating point number by the integers at each step and was getting more off than what i should have thought reasonable so then i changed strategy and multiplied all the integers and at the end divided by the product.Assuming integer multiplication is exact would not the 2nd way of doing all the integer multiplications first and then divide the floating point number by the final(rather large but not enough to overflow or underflow) result be more accurate than doing several divisions of the floating point number by the integers at each step.
The difference in these two ways was a lot more than i would have thought - like around 15% or so.
The floating point was single precision and the number of integer products was less than 20 i think. The reason i would have thought the 2nd way is better is because only have one floating point division by an integer(all be it much larger) instead of several.
Even though i am getting very large numbers(as long as not overflow): anyway at the end i will have to divide a floating point number by the integer(s). There are several steps and at first i just divided the floating point number by the integers at each step and was getting more off than what i should have thought reasonable so then i changed strategy and multiplied all the integers and at the end divided by the product.Assuming integer multiplication is exact would not the 2nd way of doing all the integer multiplications first and then divide the floating point number by the final(rather large but not enough to overflow or underflow) result be more accurate than doing several divisions of the floating point number by the integers at each step.
The difference in these two ways was a lot more than i would have thought - like around 15% or so.
The floating point was single precision and the number of integer products was less than 20 i think. The reason i would have thought the 2nd way is better is because only have one floating point division by an integer(all be it much larger) instead of several.