On Jan 6, 11:55=A0am, "Eric I." <rubytrain... / gmail.com> wrote:
>
> # mathn provides us with fractional (rational) results for partial
> # calculations rather than floating point results, which can be
> # subject to rounding errors. =A0Rounding takes place at the point of
> # final output.
> require 'mathn'

Well, it looks like I over-engineered my solution.  After noting that
Denis' updated solution and James Koppel's solution were providing the
same results as my solution, and that they were using floating point
math, I realized that my use of rational math to avoid rounding errors
and gain higher precision wasn't paying off.

So by making a change to one line in my play_dealer method:

<       card_odds =3D count / shoe[:cards_in_shoe]
---
>       card_odds =3D count.to_f / shoe[:cards_in_shoe]

my output is identical, and the program is over five times faster.
I'm a big fan of the mathn library, but clearly I should be more
careful about using it.

Eric