求a的n次幂/方,在python中,仅用2个星表达,如2**10表示2的10次方。神奇!
如在课程中说道:"In Python we can do exponentiation by using a star star. This is what we would write mathematically as to to the power 10. So 2 to the power 10 is 1024.”
1 KB = 2 ** 10
1MB = 2 ** 20
1GB = 2 ** 30
1TB = 2 ** 40
1byte = 8 bits(light switch)
2GB = 2**30 * 2 *8 ~ 17billion light switches
DRAM的读写延迟latency大概是12 nanoseconds/纳秒,1纳秒 = 10亿分之一秒
本文介绍了如何使用Python中的简单运算来实现不同内存单位之间的转换,例如从字节到千字节、兆字节等,并提供了具体的代码示例。此外还提到了DRAM的读写延迟。
213

被折叠的 条评论
为什么被折叠?



