一、问题描述
Python 官方文档在 array Efficient arrays of numeric values 里面写到:
array.frombytes(s) Appends items from the string, interpreting the string as an array of machine values (as if it had been read from a file using the fromfile() method).
请问各位大佬,machine values 在这里指的是什么?
二、其它资料
《 Fluent Python 》(P59)里面提到 array 时稍微补充说明了一下: For example, if you need to store 10 million floating-point values, an array is much more efficient, because an array does not actually hold full-fledged float objects, but only the packed bytes representing their machine valuesjust like an array in the C language.
该书中译本翻译为:比如,要存放 1000 万个浮点数的话,数组(array)的效率要高得多,因为数组在背后存的并不是 float 对象,而是数字的机器翻译,也就是字节表述。这一点就跟 C 语言中的数组一样。
《 Fluent Python 》中译本用的是“数字的机器翻译”,单从字面意思我还是猜不出来是啥。但英文版里面用 C 语言的数组做比喻,意思是“machine values”指“二进制补码”?
三、说明
劳烦各位大佬解答时最好提供参考资料,谢谢啦。
