Added code and tested. Floating pint calculations in Swift appear to be broken.