Skip to content
Snippets Groups Projects
Commit 37a6521d authored by stepan's avatar stepan
Browse files

Fix: bitwise shift with negative n returns NA

parent 8e5bd310
No related branches found
No related tags found
No related merge requests found
...@@ -91,14 +91,14 @@ public class BitwiseFunctions { ...@@ -91,14 +91,14 @@ public class BitwiseFunctions {
v = aVal ^ bVal; v = aVal ^ bVal;
break; break;
case SHIFTR: case SHIFTR:
if (bVal > 31) { if (bVal > 31 || bVal < 0) {
v = RRuntime.INT_NA; v = RRuntime.INT_NA;
} else { } else {
v = aVal >>> bVal; v = aVal >>> bVal;
} }
break; break;
case SHIFTL: case SHIFTL:
if (bVal > 31) { if (bVal > 31 || bVal < 0) {
v = RRuntime.INT_NA; v = RRuntime.INT_NA;
} else { } else {
v = aVal << bVal; v = aVal << bVal;
......
...@@ -94,3 +94,4 @@ FastR's grid implementation does not yet support: ...@@ -94,3 +94,4 @@ FastR's grid implementation does not yet support:
FastR does not plan to implement the R graphics engine display list FastR does not plan to implement the R graphics engine display list
and related functions. However, the grid display list is implemented. and related functions. However, the grid display list is implemented.
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