function number2Bytes(i) { var arr = new Int32Array(1); arr[0] = 0; var buf = Buffer.from(arr.buffer, 'hex'); buf.writeInt32BE(i); console.log("buf:", buf); console.log("buffer length :", buf.length); var iNumber = buf.readInt32BE(); c
将精度高的浮点数转换成精度低的浮点数. 1.round()内置方法 这个是使用最多的,刚看了round()的使用解释,也不是很容易懂.round()不是简单的四舍五入的处理方式. For the built-in types supporting round(), values are rounded to the closest multiple of 10 to the power minus ndigits; if two multiples are equally close, roun