当前位置:网站首页>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.
边栏推荐
- [Chinese tree tags - CTB]
- How to choose Visibility, Display, and Opacity when interacting or animating
- 【接口测试】JMeter调用JS文件实现RSA加密
- 职场如象棋,测试/开发程序员如何突破成长瓶颈期?
- C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.5 ANSI C Today
- C陷阱与缺陷 第7章 可移植性缺陷 7.10 首先释放,然后重新分配
- tiup mirror grant
- 360借条安全专家:陌生微信好友不要轻易加贷款推广多是诈骗
- Suggestions and answer 8.1 C traps and defect chapter 8
- Taobao's API to get the list of shipping addresses
猜你喜欢
随机推荐
C陷阱与缺陷 第7章 可移植性缺陷 7.7 除法运算时发生的截断
CS-NP白蛋白包覆壳聚糖纳米颗粒/人血清白蛋白-磷酸钙纳米颗粒无机复合材料
Taobao's API to get the list of shipping addresses
相亲模型与有限状态机
分类接口,淘宝分类详情 API
C语言_联合体共用体引入
Based on FPGA in any number of bytes (single-byte or multibyte) serial port (UART) to send (including source engineering)
如何让定时器在页面最小化的时候不执行?
TP5-NPs负载噻吩类化合物TP5白蛋白纳米粒/阿魏酸钠新糖牛血清蛋白纳米粒
【Kaggle】House Prices
win10版本1803无法升级1903系统如何解决
C Pitfalls and Defects Chapter 7 Portability Defects 7.11 An Example of a Portability Problem
2022年秋招,软件测试开发最全面试攻略,吃透16个技术栈
Day33 LeetCode
C专家编程 第1章 C:穿越时空的迷雾 1.3 标准I/O库和C预处理器
How to make the timer not execute when the page is minimized?
sizeof的详细解说和与strlen的区别
这些 hook 更优雅的管理你的状态
在Cesium中实现与CAD的DWG图叠加显示分析
技术栈概览









