当前位置:网站首页>C Pitfalls and Defects Chapter 7 Portability Defects 7.8 Size of Random Numbers
C Pitfalls and Defects Chapter 7 Portability Defects 7.8 Size of Random Numbers
2022-08-01 21:10:00 【weixin_Guest time】
The earliest C implementation, running on the PDP-11 computer, provided a function called rand, which produced a (pseudo)random non-negative integer.Integers are 16 bits long (including the sign bit) on PDP-11 computers, so the rand function will return an integer between 0 and 2^15-1.
A constant RAND_MAX is defined in the ANSI C standard, and its value is equal to the maximum value of random numbers.
Use the sizeof operator to measure the size in bytes of the constant, and then output its value.
边栏推荐
猜你喜欢
随机推荐
kubernetes各名词缩写
Taobao's API to get the list of shipping addresses
那些关于DOM的常见Hook封装(一)
C语言_typedef和结构体
附录A printf、varargs与stdarg A.3 stdarg.h ANSI版的varargs.h
tiup mirror clone
ISC2022 HackingClub白帽峰会倒计时1天!最全议程正式公布!元宇宙集结,精彩绝伦!
C语言之字符串函数二
tiup mirror init
ISC2022 HackingClub white hat summit countdown 1 day!Most comprehensive agenda formally announced!Yuan universe, wonderful!
with语句和上下文管理器
方舟:生存进化官服和私服区别
C陷阱与缺陷 第8章 建议与答案 8.1 建议
R语言进行相关的操作
【微信小程序】【AR】threejs-miniprogram 安装(76/100)
C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.2 Early Experience of C Language
Pytorch框架学习记录9——非线性激活
Goroutine Leaks - The Forgotten Sender
方舟开服需要知道的那些事
这些 hook 更优雅的管理你的状态