1000.0 needs and 'f' on the end, otherwise there is an implicit cast from double to float.  There are several other instances of this pattern below.