Now properly works for float. Had made wrong assumption earlier.