cast arguments of min function to same type