Create a function for float dot product instead of duplicating all over the file