📜  c# 两个数字之间的随机浮点数 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.654000             🧑  作者: Mango

代码示例1
//Notice that I think in order to use System.Random you need to import System (using System;)

static float NextFloat(float min, float max){
  System.Random random = new System.Random();
  double val = (random.NextDouble() * (max - min) + min);
  return (float)val;
}