Add handling inf and 0.