当前位置:网站首页>JS generate random numbers
JS generate random numbers
2022-07-02 03:24:00 【onYang】
const getNum = (andNum, Num) => {
//andNum Sum of random numbers ,Num Number of random numbers
var randomNum = new Array()
let sum = 0
for (var i=0;i<Num-1;i++)
{
x = Math.floor(Math.random() * (andNum - sum))
randomNum[i] = x
sum += x
}
randomNum[Num-1] = andNum - sum
return randomNum
}
getNum(50,6)边栏推荐
- Detailed explanation of the difference between Verilog process assignment
- verilog 并行块实现
- Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性
- QT environment generates dump to solve abnormal crash
- OSPF LSA message parsing (under update)
- Grpc快速实践
- 初出茅庐市值1亿美金的监控产品Sentry体验与架构
- 表单自定义校验规则
- Kotlin基础学习 15
- Halcon image rectification
猜你喜欢

创业了...

ThreadLocal详解

汇率的查询接口

Delphi xe10.4 installing alphacontrols15.12

MSI announced that its motherboard products will cancel all paper accessories

【JVM】创建对象的流程详解

How to establish its own NFT market platform in 2022

命名块 verilog

Download and use of the super perfect screenshot tool snipaste

JS introduction < 1 >
随机推荐
【JVM】创建对象的流程详解
Gradle notes
Global and Chinese market of X-ray detectors 2022-2028: Research Report on technology, participants, trends, market size and share
Intersection vengraph
tarjan2
Sentry experience and architecture, a fledgling monitoring product with a market value of $100million
Use blocking or non blocking for streamline
Render header usage of El table
/silicosis/geo/GSE184854_ scRNA-seq_ mouse_ lung_ ccr2/GSE184854_ RAW/GSM5598265_ matrix_ inflection_ demult
初出茅庐市值1亿美金的监控产品Sentry体验与架构
Start a business
C # joint Halcon's experience of breaking away from Halcon environment and various error reporting solutions
MySQL advanced (Advanced) SQL statement (II)
aaaaaaaaaaaaa
高并发场景下缓存处理方案
Qualcomm platform wifi-- WPA_ supplicant issue
JIT deep analysis
Verilog 过程赋值 区别 详解
PHP array processing
IPhone 6 plus is listed in Apple's "retro products" list