Skip to content

Commit

Permalink
fix float32&64 in serialize.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
chuck-h authored Oct 11, 2023
1 parent 1b5fc08 commit a2e583c
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 a2e583c

Please sign in to comment.