Skip to content
Snippets Groups Projects
Commit 23a1f82c authored by Kristof Szabados's avatar Kristof Szabados
Browse files

in newer version of the standard nans equal.


Signed-off-by: default avatarkristof <Kristof.Szabados@ericsson.com>
parent d405730a
No related branches found
No related tags found
No related merge requests found
......@@ -105,7 +105,7 @@ struct ttcn3float {
bool operator>(double d) const {
if (isnan(value)) {
return true; // TTCN-3 special: NaN is bigger than anything except NaN
return !isnan(d); // TTCN-3 special: NaN is bigger than anything except NaN
}
else if (isnan(d)) {
return false; // TTCN-3 special: NaN is bigger than anything except NaN
......
......@@ -429,7 +429,8 @@ testcase floatComparison() runs on floatOper_comptype {
var float NaN := not_a_number;
if (NaN != not_a_number) { setverdict(fail, __LINE__, ": not_a_number==not_a_number:NotOK") }
if (NaN < NaN) { setverdict(fail, __LINE__, ": not_a_number<not_a_number:NotOK") }
if (NaN > NaN) { setverdict(fail, __LINE__, ": not_a_number<not_a_number:NotOK") }
}
testcase constFloatComparison() runs on floatOper_comptype {
......@@ -476,7 +477,8 @@ testcase constFloatComparison() runs on floatOper_comptype {
const float NaN := not_a_number;
if (NaN != not_a_number) { setverdict(fail, __LINE__, ": not_a_number==not_a_number:NotOK") }
if (NaN < NaN) { setverdict(fail, __LINE__, ": not_a_number<not_a_number:NotOK") }
if (NaN > NaN) { setverdict(fail, __LINE__, ": not_a_number<not_a_number:NotOK") }
}
control {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment