Skip to content

Commit 2825f54

Browse files
Merge pull request diffblue#4498 from romainbrenguier/bugfix/double-printing
Fix bug in the printing of double for limit values
2 parents 5d80ef9 + edfccab commit 2825f54

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed
413 Bytes
Binary file not shown.

jbmc/regression/jbmc/double1/double1.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,13 @@ public static void main(String[] args)
1919
d=java.lang.Double.NEGATIVE_INFINITY;
2020
d=java.lang.Double.NaN;
2121
}
22+
23+
public static String testLimit(double inputValue) {
24+
if(0x1p-1022 == inputValue){
25+
assert(false);
26+
return "reach";
27+
}
28+
return "default";
29+
}
2230
}
2331

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
double1.class
3+
--function double1.testLimit --trace
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
INPUT arg0d: 0x1(\.0*)?p-1022 /\* 2.22507e-308
8+
--
9+
^warning: ignoring
10+
--
11+
Test double value are printed with sufficient precision

jbmc/src/java_bytecode/expr2java.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ std::string floating_point_to_java_string(float_type value)
7979
return raw_decimal;
8080
}();
8181
const bool is_lossless = [&] {
82-
if(value == std::numeric_limits<float_type>::min())
83-
return true;
8482
try
8583
{
8684
return std::stod(decimal) == value;

0 commit comments

Comments
 (0)