returns NaN if factor is invalid.