mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2026-01-25 21:24:13 +01:00
Correct support rshift for 64-bit numbers
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import calc from "../core/calc";
|
||||
import { NumberType } from "../core/types";
|
||||
import ScalarValue from "./ScalarValue";
|
||||
|
||||
@@ -20,7 +21,7 @@ function evalute(op1 : NumberType, operator: string, op2 : NumberType) : NumberT
|
||||
switch(operator) {
|
||||
case ">>": return (a >> b) as (NumberType);
|
||||
case ">>>": return (a >>> b) as (NumberType);
|
||||
case "<<": return (a << b) as (NumberType);
|
||||
case "<<": return calc.rshift(a, b, calc.maxBitSize(a));
|
||||
case "&": return (b & a) as (NumberType);
|
||||
case "|": return (b | a) as (NumberType);
|
||||
case "^": return (b ^ a) as (NumberType);
|
||||
|
||||
@@ -13,7 +13,7 @@ interface ParserConfig {
|
||||
}
|
||||
|
||||
export interface ParsedNumber {
|
||||
value: number|bigint;
|
||||
value: NumberType;
|
||||
base: NumberBase;
|
||||
input: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user