Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.

Commit ef16cc0

Browse files
committed
Fix an issue with writing float and double.
1 parent c8145cc commit ef16cc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lang/src/main/java/net/openhft/lang/io/NativeBytes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ public void writeFloat(float v) {
627627
public void writeFloat(long offset, float v) {
628628
offsetChecks(offset, 4L);
629629
// UNSAFE.putFloat(startAddr + offset, v);
630-
Bits.putFloat(startAddr + offset, Float.floatToIntBits(v));
630+
Bits.putFloat(startAddr + offset, v);
631631
}
632632

633633
@Override
@@ -642,7 +642,7 @@ public void writeDouble(double v) {
642642
public void writeDouble(long offset, double v) {
643643
offsetChecks(offset, 8L);
644644
//UNSAFE.putDouble(startAddr + offset, v);
645-
Bits.putDouble(startAddr + offset, Double.doubleToLongBits(v));
645+
Bits.putDouble(startAddr + offset, v);
646646
}
647647

648648
@Override

0 commit comments

Comments
 (0)