Tell us what’s happening:
I’m doing the cash register stuff, and while doing that i did the following operation ;
2.05 / 0.05 . The answer is 41.
The result shown while using console.log to check out i’m doing okay was : 40.99999999
I intend to use this result in iterative operations in my following code. I would do a loop with a ( 2.05/0.05) -1 for each iteration.
Here is my question ; if i did my (2.05/0.05) -1 for each iteration, would i have done 41 or 40 with 0.04999999 left ?
If it’s just a display problem i don’t really care, however if it does only 40 iterations it would be really problematic…
I’m really far from ending my code and i don’t wish to go check if i would have had problem due to this right now. I just used Math.round in every operation to feel safe.
Thank you for your time , wish you the best.
**Your browser information:**
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.96.36.199 Safari/537.36
Challenge: Cash Register
Link to the challenge: