sets +Inf and -Inf for ranges outside (min, max)

NOTE this follows REP 117
http://www.ros.org/reps/rep-0117.html
removes trailing spaces and makes code easier to read