Add macro to ensure value between range