###
#    public int nextInt(int bound) {
#        if (bound <= 0)
#            throw new IllegalArgumentException(BadBound);
#
#        int r = next(31);
#        int m = bound - 1;
#        if ((bound & m) == 0)  // i.e., bound is a power of 2
#            r = (int)((bound * (long)r) >> 31);
#        else {
#            for (int u = r; u - (r = u % bound) + m < 0; u = next(31));
#        }
#        return r;
#    }

function math:rng/lcg

scoreboard players operation #temp math = out math
scoreboard players operation out math %= #range math
scoreboard players operation #temp math -= out math
scoreboard players operation #temp math += #m1 math
execute if score #temp math matches ..-1 run function math:rng/zprivate/next_int














# = 904234234

# temp = 904234234
# 904234234 %= 100, = 34
# 904234234 -= 34, = 904234200
# 904234200 += 100 = 904234300








# = -19237436236

# temp = -19237436236
# -19237436236 %= 100, = 64
# -19237436236 -=










