Skip to content

Commit c383fd7

Browse files
committed
Handle NaN values in CloudFloat comparison
1 parent 84de29f commit c383fd7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/property/types/CloudFloat.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ class CloudFloat : public Property {
4646
return _value;
4747
}
4848
virtual bool isDifferentFromCloud() {
49-
return _value != _cloud_value && (abs(_value - _cloud_value) >= Property::_min_delta_property);
49+
if (std::isnan(_value) || std::isnan(_cloud_value)) {
50+
return std::isnan(_value) != std::isnan(_cloud_value);
51+
}
52+
return _value != _cloud_value && fabs(_value - _cloud_value) >= Property::_min_delta_property;
5053
}
5154
virtual void fromCloudToLocal() {
5255
_value = _cloud_value;

0 commit comments

Comments
 (0)