Make conversions and doubles comparisons explicit.
Merge pull request #81 from Dmitry-Me/doublescomparison

It seems my implementation was sloppy. Thank you for making the code clearer.