Skip to content

Commit

Permalink
Meta.is_same_object NaN NaN returns True
Browse files Browse the repository at this point in the history
  • Loading branch information
Akirathan committed Apr 17, 2023
1 parent 6302281 commit 32d81f4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ public static IsSameObjectNode build() {

public abstract boolean execute(@AcceptsError Object left, @AcceptsError Object right);

@Specialization
boolean isSameDouble(double left, double right) {
if (Double.isNaN(left) && Double.isNaN(right)) {
return true;
} else {
return left == right;
}
}

@Specialization
boolean isSameType(Type typeLeft, Type typeRight) {
return typeLeft == typeRight;
Expand Down

0 comments on commit 32d81f4

Please sign in to comment.