Skip to content

Commit 8b4ba92

Browse files
committed
expr2java/floating point output: Lossless-test needs to use is_float
1 parent 3afbc40 commit 8b4ba92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jbmc/src/java_bytecode/expr2java.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ std::string floating_point_to_java_string(float_type value)
8181
return true;
8282
try
8383
{
84-
return std::stod(decimal) == value;
84+
if(is_float)
85+
return std::stof(decimal) == value;
86+
else
87+
return std::stod(decimal) == value;
8588
}
8689
catch(std::out_of_range &)
8790
{

0 commit comments

Comments
 (0)