Skip to content

Commit

Permalink
Update serialize.dart: floats (#1945)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuck-h authored Apr 26, 2024
1 parent a638dfb commit 160ffc7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/crypto/eosdart/src/serialize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ class SerialBuffer {

// /** Get a `float32` */
double getFloat32() {
return getUint8List(4).buffer.asFloat32List()[0];
var rp = readPos;
getUint8List(4);
return array.buffer.asByteData(rp).getFloat32(0, Endian.little);
}

// /** Append a `float64` */
Expand All @@ -222,7 +224,9 @@ class SerialBuffer {

// /** Get a `float64` */
double getFloat64() {
return getUint8List(8).buffer.asFloat64List()[0];
var rp = readPos;
getUint8List(8);
return array.buffer.asByteData(rp).getFloat64(0, Endian.little);
}

/// Append a `name` */
Expand Down

0 comments on commit 160ffc7

Please sign in to comment.