Function which returns the nearest integer to x; for half-integers, a rounding rule must be chosen, usually to round half-integers to the nearest even integer.