File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
exist-core/src/main/java/org/exist/xquery/value Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,11 @@ public boolean isPositive() {
147
147
@ Override
148
148
protected @ Nullable IntSupplier createComparisonWith (final NumericValue other ) {
149
149
final IntSupplier comparison ;
150
- if (isInfinite () && other .isInfinite () && isPositive () == other .isPositive ()) {
150
+ if (isNaN ()) {
151
+ comparison = () -> Constants .INFERIOR ;
152
+ } else if (other .isNaN ()) {
153
+ comparison = () -> Constants .SUPERIOR ;
154
+ } else if (isInfinite () && other .isInfinite () && isPositive () == other .isPositive ()) {
151
155
comparison = () -> Constants .EQUAL ;
152
156
} else if (other instanceof IntegerValue ) {
153
157
comparison = () -> BigDecimal .valueOf (value ).compareTo (new BigDecimal (((IntegerValue ) other ).value ));
Original file line number Diff line number Diff line change @@ -150,8 +150,11 @@ public boolean isPositive() {
150
150
@ Override
151
151
protected @ Nullable IntSupplier createComparisonWith (final NumericValue other ) {
152
152
final IntSupplier comparison ;
153
-
154
- if (isInfinite () && other .isInfinite () && isPositive () == other .isPositive ()) {
153
+ if (isNaN ()) {
154
+ comparison = () -> Constants .INFERIOR ;
155
+ } else if (other .isNaN ()) {
156
+ comparison = () -> Constants .SUPERIOR ;
157
+ } else if (isInfinite () && other .isInfinite () && isPositive () == other .isPositive ()) {
155
158
comparison = () -> Constants .EQUAL ;
156
159
} else if (other instanceof IntegerValue ) {
157
160
comparison = () -> BigDecimal .valueOf (value ).compareTo (new BigDecimal (((IntegerValue )other ).value ));
You can’t perform that action at this time.
0 commit comments