From 9aa2d37c9350d42c5f0666661b2a00909366e3f2 Mon Sep 17 00:00:00 2001 From: Roel van Uden Date: Fri, 6 Feb 2015 21:48:53 +0100 Subject: [PATCH 1/2] Update big-integer with bitwise operations --- big-integer/big-integer.d.ts | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/big-integer/big-integer.d.ts b/big-integer/big-integer.d.ts index dfadc4962..8b688d47c 100644 --- a/big-integer/big-integer.d.ts +++ b/big-integer/big-integer.d.ts @@ -1,6 +1,6 @@ // Type definitions for BigInteger.js // Project: https://github.com/peterolson/BigInteger.js -// Definitions by: Ingo Bürk +// Definitions by: Ingo Bürk , Roel van Uden // Definitions: https://github.com/borisyankov/DefinitelyTyped interface BigInteger { @@ -167,6 +167,34 @@ interface BigInteger { /** Checks if two numbers are not equal. */ notEquals( number: string ): boolean; + /** Performs the bitwise AND operation. */ + and( number: number ): BigInteger; + /** Performs the bitwise AND operation. */ + and( number: BigInteger ): BigInteger; + /** Performs the bitwise AND operation. */ + and( number: string ): BigInteger; + + /** Performs the bitwise NOT operation. */ + not( number: number ): BigInteger; + /** Performs the bitwise NOT operation. */ + not( number: BigInteger ): BigInteger; + /** Performs the bitwise NOT operation. */ + not( number: string ): BigInteger; + + /** Performs the bitwise OR operation. */ + or( number: number ): BigInteger; + /** Performs the bitwise OR operation. */ + or( number: BigInteger ): BigInteger; + /** Performs the bitwise OR operation. */ + or( number: string ): BigInteger; + + /** Performs the bitwise XOR operation. */ + xor( number: number ): BigInteger; + /** Performs the bitwise XOR operation. */ + xor( number: BigInteger ): BigInteger; + /** Performs the bitwise XOR operation. */ + xor( number: string ): BigInteger; + /** Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. */ toJSNumber(): number; From 6de136877ae7aa393d1866e4cd688c4cb270253f Mon Sep 17 00:00:00 2001 From: Roel van Uden Date: Mon, 9 Feb 2015 18:43:41 +0100 Subject: [PATCH 2/2] Fix the NOT method declaration as per feedback --- big-integer/big-integer.d.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/big-integer/big-integer.d.ts b/big-integer/big-integer.d.ts index 8b688d47c..633432e19 100644 --- a/big-integer/big-integer.d.ts +++ b/big-integer/big-integer.d.ts @@ -175,11 +175,7 @@ interface BigInteger { and( number: string ): BigInteger; /** Performs the bitwise NOT operation. */ - not( number: number ): BigInteger; - /** Performs the bitwise NOT operation. */ - not( number: BigInteger ): BigInteger; - /** Performs the bitwise NOT operation. */ - not( number: string ): BigInteger; + not(): BigInteger; /** Performs the bitwise OR operation. */ or( number: number ): BigInteger;