espringe/moneypot — pull request #11 by kungfuant (2014-09-27 22:50:18+00:00)
Title: Calculator update.

Feel free to pull this or not. The patch set updates the calculator code to precisely follow the implementation of genGameCrash() in the server. The code is clearly more complicated though.

The winProb() function uses integers as long as possible and does one division at the end to achieve numerical stability, so you get nice numbers for example at wager 100 and cashout 111. One could do the same to the houseExpectedReturn() but I'm too lazy to do that.