using double instead of float for scalefactor
Merge pull request #174 from haiwen/fix_type_of_scale_factor

using double instead of float for scalefactor