Closed Mahorori closed 4 years ago
Because it should have been ?
? What is the expected answer?
Few things, if you meant a 32-bit integer, you need to do 32 and not 4. As for the dst2.simplify().to_string().c_str()
, simplification is done automatically when you do an operation and std::string can be passed as is to logger so you could just do dst2.to_string()
.
expression op1 = { {"op1"}, 32 };
expression op2 = { {"op2"}, 32 };
// Out: (op1==op2)
// ?
auto dst1 = op1 == op2;
log( "%s\n", dst1.to_string() );
log( "%s\n", dst1.value.to_string() );
// Out: ((op1-op2)==0x0)
// ?
auto dst2 = ( op1 - op2 ) == 0;
log( "%s\n", dst2.to_string() );
log( "%s\n", dst2.value.to_string() );
Also if you are not using this equality comparison in a statement, I'd recommend using expression::equals / expression::is_identical
instead.
yes the result should've been unknown I think. and It's been fixed, thank you for the quick fix and even advice for improving my code :) and indeed i'm using it as statement to check if it's symbolized or not