All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gitee.cliveyuan.tools.MathTools Maven / Gradle / Ivy

There is a newer version: 4.0.6
Show newest version
package com.gitee.cliveyuan.tools;

import java.util.Random;

/**
 * 数学相关工具
 *
 * @author clive
 * Created on 2018/07/24
 * @since 1.0
 */
public class MathTools {

    private MathTools(){}

    public static int randomInt(int min, int max) {
        if (min == max) return min;
        Assert.isTrue(min < max, "min must great than max");
        Random random = new Random();
        return random.nextInt(max) % (max - min + 1) + min;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy