Add explicit static cast 

Add explicit static cast from double to float since a implicit cast isn't allowed any longer when using c++11.