My app calculated like this.
float containTaxValue = 840;
float taxRate = 5;
float divisionedNum = (100 + taxRate)/100;
float removedTaxValue = containTaxValue/divisionedNum;
float taxValue = containTaxValue - removedTaxValue;
finally the answer is
NSLog(@"%f",removedTaxValue); => 800.000061
NSLog(@"%f",containTaxValue); => 840.000000
NSLog(@"%f",taxValue); => 39.999939
I would like to get "taxValue == 40.000000" in this code.
I couldn't make sense what's issue. Let me know any advise please.