I am trying to round integers in python. I looked at the built-in round() function but it seems that that rounds floats.
My goal is to round integers to the closest
round(..) function returning a floatThat float (double-precision in Python) is always a perfect representation of an integer, as long as it's in the range [-253..253]. (Pedants pay attention: it's not two's complement in doubles, so the range is symmetric about zero.)
See the discussion here for details.