mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 17:08:21 +08:00
Fix big-integer comparison method return types
This commit is contained in:
@@ -6,7 +6,7 @@ var noArgument = bigInt(),
|
||||
stringArgument = bigInt( "75643564363473453456342378564387956906736546456235345" ),
|
||||
baseArgumentInt = bigInt( "101010", 2 ),
|
||||
baseArgumentStr = bigInt( "101010", "2" ),
|
||||
baseArgumentBi = bigInt( "101010", bigInt( 2 ) ),
|
||||
baseArgumentBi = bigInt( "101010", bigInt( 2 ) ),
|
||||
bigIntArgument = bigInt( noArgument );
|
||||
|
||||
// method tests
|
||||
@@ -26,13 +26,13 @@ isBigInteger = x.add( 0 );
|
||||
isBigInteger = x.add( x );
|
||||
isBigInteger = x.add( "100" );
|
||||
|
||||
isBigInteger = x.compare( 0 );
|
||||
isBigInteger = x.compare( x );
|
||||
isBigInteger = x.compare( "100" );
|
||||
isNumber = x.compare( 0 );
|
||||
isNumber = x.compare( x );
|
||||
isNumber = x.compare( "100" );
|
||||
|
||||
isBigInteger = x.compareAbs( 0 );
|
||||
isBigInteger = x.compareAbs( x );
|
||||
isBigInteger = x.compareAbs( "100" );
|
||||
isNumber = x.compareAbs( 0 );
|
||||
isNumber = x.compareAbs( x );
|
||||
isNumber = x.compareAbs( "100" );
|
||||
|
||||
isBigInteger = x.divide( 0 );
|
||||
isBigInteger = x.divide( x );
|
||||
|
||||
12
big-integer/big-integer.d.ts
vendored
12
big-integer/big-integer.d.ts
vendored
@@ -134,24 +134,24 @@ interface BigInteger {
|
||||
* Performs a comparison between two numbers. If the numbers are equal, it returns 0.
|
||||
* If the first number is greater, it returns 1. If the first number is lesser, it returns -1.
|
||||
*/
|
||||
compare( number: number ): BigInteger;
|
||||
compare( number: number ): number;
|
||||
/**
|
||||
* Performs a comparison between two numbers. If the numbers are equal, it returns 0.
|
||||
* If the first number is greater, it returns 1. If the first number is lesser, it returns -1.
|
||||
*/
|
||||
compare( number: BigInteger ): BigInteger;
|
||||
compare( number: BigInteger ): number;
|
||||
/**
|
||||
* Performs a comparison between two numbers. If the numbers are equal, it returns 0.
|
||||
* If the first number is greater, it returns 1. If the first number is lesser, it returns -1.
|
||||
*/
|
||||
compare( number: string ): BigInteger;
|
||||
compare( number: string ): number;
|
||||
|
||||
/** Performs a comparison between the absolute value of two numbers. */
|
||||
compareAbs( number: number ): BigInteger;
|
||||
compareAbs( number: number ): number;
|
||||
/** Performs a comparison between the absolute value of two numbers. */
|
||||
compareAbs( number: BigInteger ): BigInteger;
|
||||
compareAbs( number: BigInteger ): number;
|
||||
/** Performs a comparison between the absolute value of two numbers. */
|
||||
compareAbs( number: string ): BigInteger;
|
||||
compareAbs( number: string ): number;
|
||||
|
||||
/** Checks if two numbers are equal. */
|
||||
equals( number: number ): boolean;
|
||||
|
||||
Reference in New Issue
Block a user