ngen_random.c
来自「su 的源代码库」· C语言 代码 · 共 61 行
C
61 行
/* Copyright (c) Colorado School of Mines, 2006.*//* All rights reserved. *//*************************************************************//* *//* Copyright (c) 1993 *//* Wenceslau Gouveia *//* Center for Wave Phenomena *//* Colorado School of Mines *//* *//* Permission is hereby granted to copy all or any part of *//* this program for free distribution. The author's name *//* and this copyright notice must be included in any copy. *//* *//*************************************************************//* * file: genesis_random.c * * author: Wenceslau Gouveia * * created: 1993 * * purpose: Alternative random generators for GENESIS * */#include "cwp.h"extern float franuni();double Rand(){ double random; random = (double) franuni(); return(random);}int Randint(low,high)int low, high;{ float random; int intrandom; random = franuni(); intrandom = (int) (random * (high - low + 1) + low); return (intrandom);}double Randdouble(dlow,dhigh)double dlow, dhigh;{ float random; double drandom; random = franuni(); drandom = (double) (random * (dhigh - dlow) + dlow); return (drandom);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?