This question already has an answer here:
- Can't do any integer division 4 answers
First, I know that fixed point integers are coming...but I really need to know how to accomplish a simple operation who return a rational number.
For example, get 2% of 350 is easy implementing: 350/50 because the result is an integer = 7. However, 2% of 340 is not easy...the result is 6,8...so how can I get 0.8?
I´ve tried several ways...but I can't do it. Is there any library or smt related to math applied to division?