Skip to content

Commit

Permalink
chore: fix formatting and parse test
Browse files Browse the repository at this point in the history
  • Loading branch information
bhelx committed Sep 25, 2023
1 parent 2d13ac7 commit 740b86f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public static long longVal(String v) {
return new BigInteger(v).longValue();
}

public static float floatVal(String s) {
public static float floatVal(String s) {
return Float.intBitsToFloat(Integer.parseInt(s));
}
}

public static double doubleVal(String s) {
return Double.longBitsToDouble(longVal(s));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public static long longVal(String v) {
return new BigInteger(v).longValue();
}

public static float floatVal(String s) {
public static float floatVal(String s) {
return Float.intBitsToFloat(Integer.parseInt(s));
}
}

public static double doubleVal(String s) {
return Double.longBitsToDouble(longVal(s));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public void shouldEncodeValuesFromLong() {
var i64 = Value.i64(123L);
assertEquals("123@i64", i64.toString());
var f32 = Value.f32(123L);
assertEquals("6.64614E35@f32", f32.toString());
assertEquals("1.72E-43@f32", f32.toString());
var f64 = Value.f64(123L);
assertEquals("2.974033816955566E284@f64", f64.toString());
assertEquals("6.1E-322@f64", f64.toString());
}
}

0 comments on commit 740b86f

Please sign in to comment.