2022-10-17 15:19:18 +08:00

12 lines
394 B
TypeScript

import WuhuBase from "../WuhuBase";
export default class MathUtils extends WuhuBase {
className = 'MathUtils';
// 得到一个两数之间的随机整数
public getRandomInt(min: number, max: number): number {
min = Math.ceil(min);
max = Math.floor(max);
//不含最大值,含最小值
return Math.floor(Math.random() * (max - min)) + min;
}
}