mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
0172510c66
2 changed files with 8 additions and 1 deletions
|
@ -1042,6 +1042,9 @@ public class BigFloat implements Comparable<BigFloat> {
|
||||||
if (isInfinite()) {
|
if (isInfinite()) {
|
||||||
return sign < 0 ? NEGATIVE_INFINITY : POSITIVE_INFINITY;
|
return sign < 0 ? NEGATIVE_INFINITY : POSITIVE_INFINITY;
|
||||||
}
|
}
|
||||||
|
if (isZero()) {
|
||||||
|
return sign < 0 ? "-0.0" : "0.0";
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1480,7 +1480,11 @@ public class FloatFormatTest extends AbstractGenericTest {
|
||||||
@Test
|
@Test
|
||||||
public void testValueOfBigInteger() {
|
public void testValueOfBigInteger() {
|
||||||
FloatFormat ff = FloatFormatFactory.getFloatFormat(8);
|
FloatFormat ff = FloatFormatFactory.getFloatFormat(8);
|
||||||
assertEquals("0.0", ff.toDecimalString(ff.getBigFloat(BigInteger.ZERO)));
|
|
||||||
|
assertFalse(ff.getBigZero(true).equals(ff.getBigZero(false)));
|
||||||
|
|
||||||
|
assertEquals("-0.0", ff.toDecimalString(ff.getBigZero(true)));
|
||||||
|
assertEquals("0.0", ff.toDecimalString(ff.getBigZero(false)));
|
||||||
assertEquals("1.0", ff.toDecimalString(ff.getBigFloat(BigInteger.ONE)));
|
assertEquals("1.0", ff.toDecimalString(ff.getBigFloat(BigInteger.ONE)));
|
||||||
assertEquals("2.0", ff.toDecimalString(ff.getBigFloat(BigInteger.TWO)));
|
assertEquals("2.0", ff.toDecimalString(ff.getBigFloat(BigInteger.TWO)));
|
||||||
assertEquals("-1.0", ff.toDecimalString(ff.getBigFloat(BigInteger.ONE.negate())));
|
assertEquals("-1.0", ff.toDecimalString(ff.getBigFloat(BigInteger.ONE.negate())));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue