Hey, im trying to fix this code I wrote, its a simple dice rolling game but im having a problem trying to end the loop. I want it to end if balance = 0 or if user inputs -1.
When I input -1 it stills asks me one more time before ending the program, and it wont end if bank balance is 0.
You shouldn't compare floats for equality because in the representation you have trunc error
Either use an epsilon fabs(a - b) < epsilon or try to work around with integers (think in cents)