ERRATA: 91.1 vs 91.0999999

In the book:

In my Xcode:

Looks like Xcode has changed its mind about how it wants to format those values. Thank you for posting this!

I also wanted to pint out that 91.2 works correctly

Not sure what’s up with 91.1

But to make correct I do see that this will work.

let fmStation = 91.1
let floatFromDouble = Float(fmStation)

Running Xcode 6.4 on OS X 10.10.4, I also observe the same result in the sidebar when specifying

let fmStation: 91.1

To solve it, I simply specified the type as “Float”:

let fmStation:Float 91.1

https://www.dropbox.com/s/x2eigxdc1lhym33/Specifying%20Float%20for%2091x.png?dl=0

Thanks.

This appears to be an inconsistency in how the various precisions of Float are handled:
var floatVar = 91.1 91.09999999999999
var floatVar1: Float
floatVar1 = 91.1 91.1
var floatVar2: Float64
floatVar2 = 91.1 91.09999999999999
var floatVar3: Float80
floatVar3 = 91.1 91.1

floatVar /= 1.001 91.00899100899102
floatVar1 /= 1.001 91.00899
floatVar3 /= 1.001 91.008991008991009