当前位置:网站首页>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.
边栏推荐
猜你喜欢

MySQL 中出现的字符编码错误 Incorrect string value: ‘\x\x\x\x‘ for column ‘x‘

方舟:生存进化PVE模式和PVP模式

Pytorch学习记录(八):生成对抗网络GAN

StringTable Detailed String Pool Performance Tuning String Concatenation

LeetCode·每日一题·1374.生成每种字符都是奇数个的字符串·模拟

包含吲哚菁绿的多聚体白蛋白纳米球/载马钱子碱纳米粒的牛血清白蛋白微球的制备

Hiking, cured my mental internal friction

ORI-GB-NP半乳糖介导冬凌草甲素/姜黄素牛血清白蛋白纳米粒的研究制备方法

Internet使用的网络协议是什么

STAHL touch screen repair all-in-one display screen ET-316-TX-TFT common faults
随机推荐
C陷阱与缺陷 第7章 可移植性缺陷 7.6 内存位置0
响应式织梦模板美容整形类网站
C Expert Programming Preface
那些关于DOM的常见Hook封装(二)
360借条安全专家:陌生微信好友不要轻易加贷款推广多是诈骗
网络安全与基础设施安全局(CISA):两国将在网络安全方面扩大合作
tiup mirror init
包含吲哚菁绿的多聚体白蛋白纳米球/载马钱子碱纳米粒的牛血清白蛋白微球的制备
附录A printf、varargs与stdarg A.1 printf函数族
2022年秋招,软件测试开发最全面试攻略,吃透16个技术栈
Hiking, cured my mental internal friction
R语言进行相关的操作
system collection
Review Set/Map basics with these two hooks
LeetCode
C陷阱与缺陷 第5章 库函数 5.5 库函数signal
StringTable Detailed String Pool Performance Tuning String Concatenation
PyTorch笔记 - Attention Is All You Need (2)
tiup mirror clone
Graph adjacency matrix storage