input are 2 float numbers: num1, num2, calculate num = num1*num2.
Eg: num1 = 2.09,num2 = 33.85 num = num1 * num2 = 70.74649 num's accurate value is 70.7465
I know we can choose to convert float to int value first by:
int intNum1 = num1 * 100;
int intNum2 = num2 * 100;
int intNum = intNum1 * intNum2;
num = intNum / 10000;
Is there another solution to get accurate result? thanks.