当前位置:网站首页>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)边栏推荐
- Go执行shell命令
- JS <2>
- Verilog reg register, vector, integer, real, time register
- Work hard all day long and be alert at sunset
- 2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
- Continuous assignment of Verilog procedure
- Kotlin基础学习 16
- 焱融看 | 混合云时代下,如何制定多云策略
- Calculation of page table size of level 2, level 3 and level 4 in protection mode (4k=4*2^10)
- On redis (II) -- cluster version
猜你喜欢

PY3, PIP appears when installing the library, warning: ignoring invalid distribution -ip

Verilog state machine

Verilog 过程赋值 区别 详解

Framing in data transmission

焱融看 | 混合云时代下,如何制定多云策略

Verilog 时序控制

verilog 并行块实现

Named block Verilog

Screenshot literacy tool download and use

Continuous assignment of Verilog procedure
随机推荐
The capacity is upgraded again, and the new 256gb large capacity specification of Lexar rexa 2000x memory card is added
Gradle notes
GSE104154_ scRNA-seq_ fibrotic MC_ bleomycin/normalized AM3
[JVM] detailed description of the process of creating objects
ZABBIX API creates hosts in batches according to the host information in Excel files
Xiaomi, a young engineer, was just going to make soy sauce
[数据库]JDBC
Review materials of project management PMP high frequency examination sites (8-1)
Cache processing scheme in high concurrency scenario
焱融看 | 混合云时代下,如何制定多云策略
Verilog 时序控制
verilog 并行块实现
V-model of custom component
Common means of modeling: aggregation
MMSegmentation系列之训练与推理自己的数据集(三)
[JS reverse series] analysis of a customs publicity platform
Sentry experience and architecture, a fledgling monitoring product with a market value of $100million
MSI announced that its motherboard products will cancel all paper accessories
Verilog 过程赋值 区别 详解
旋转框目标检测mmrotate v0.3.1 学习模型