基于C语言什么的算法是RAND()? [英] What algorithm is Rand() based on in C language?

查看:145
本文介绍了基于C语言什么的算法是RAND()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究RAND()一会儿来源$ C ​​$ C,但到现在为止我无法找出函数的全貌。

I have been researching the source code of Rand() for a while, but until now I couldn't figure out the whole picture of the function.

以下是源$ C ​​$ CS发现,由我研究的:

The following are the source codes found and researched by me:

<一个href="https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/rand.c;h=db0b214473c44b9c1acacf1ebd00e8f5c9ef639b;hb=HEAD"相对=nofollow> rand.c

<一个href="https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/random.c;h=7c033df9aa5d62be3a7bd6f2d1ac43cf9f4478c4;hb=HEAD"相对=nofollow> random.c

可能有人提供一些建议和帮助我吗?

Could somebody provide some advices or assistance for me?

太感谢了!

推荐答案

兰德是基于像MAC地址的几件事情应该是每台机器上独一无二的。有几个实现,以验证该返回值是随机的

Rand is based on several things like mac address which should be unique on every machine. there are several implementations to verify that the returned value is "random"

这篇关于基于C语言什么的算法是RAND()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆