I am trying to multiply two double-type numbers to get another double. However, C++ seems to be rounding the result, eg when a = 1.001, b = 1001, the result for a*b is 1002, rather than 1002.001 as I would like. How can I fix this?
Thanks for the response! I didn't realise floating point arithmetic was so imprecise. I've rewritten the program avoiding having non-integers and it works fine now.