average is not always integral type