import math


def round_half_up(x):
    """
    Return x rounded to the nearest integer, with halves rounded up to match
    SLiM's behaviour. Python's round() function rounds halves to the nearest
    even number.
    """
    floor_x = math.floor(x)
    if x - floor_x < 0.5:
        return floor_x
    else:
        return math.ceil(x)