Skip to content

Commit

Permalink
Merge pull request #10 from White-Dews/master
Browse files Browse the repository at this point in the history
🚀 v1.2.8 修复获取随机数(整数)最小值控制
  • Loading branch information
linyisonger authored Apr 1, 2023
2 parents 0863e38 + 09fe3e9 commit 5f4aec2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 🚀v1.2.8 修复获取随机数(整数)最小值控制
🔧: 修复获取随机数(整数)最小值控制

### 🚀v1.2.7 防抖/节流拆分/随机获取颜色
➕: getRandomColor 随机获取颜色
➕: antiShake 防抖 阻断调用 常用于提交
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@3r/tool",
"version": "1.2.7",
"version": "1.2.8",
"description": "🏃‍包含一些常用方法例如对象深克隆/数组交集、并集、差集/二维向量点乘、叉乘/股票KDJ、MACD、RSI、BOLL/验证为空、车牌号、邮箱、身份证、统一社会信用代码、手机号、版本对比/转换日期、星座、身份证解析、字节...持续更新整合",
"main": "index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/randoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class Randoms {
* @returns 随机数 [min,max)
*/
static getRandomInt(min: number, max: number): number {
return Math.floor(Math.random() * max) - min
return ~~(Math.random() * max) + min
}

/**
Expand Down

0 comments on commit 5f4aec2

Please sign in to comment.