bytesFromDouble static method

List<int> bytesFromDouble(
  1. double number, [
  2. Endian endian = Endian.big
])

Convert a 64 bit double number to its int representation.

Implementation

static List<int> bytesFromDouble(double number,
    [Endian endian = Endian.big]) {
  var tmp = Uint8List.fromList([0, 0, 0, 0, 0, 0, 0, 0]);
  ByteData bdata = ByteData.view(tmp.buffer);
  bdata.setFloat64(0, number, endian);
  return tmp;
}