Fix data type mixup
I'm not that well acquainted with the code base but I think there is a mixup of float and double data types in some functions.
Some float data type functions wrongly use double.
This MR fixes this data type mixup.
CC: @aarregi, @thomaswucher
Edited by 6arms1leg