...

View Full Version : Problem with BigInt.js , not performing subtraction on bigninteger numbers



dinesh.matta
07-19-2011, 12:04 PM
Hello,

I am using BigInt.js javascript package for performing arithmetic operations on
biginteger numbers.

Following are some of the interfaces provided by this plugin:

// Interfaces:
// x = new BigInt("1234567890123456789012345678901234567890");
// y = new BigInt("0x123456789abcdef0123456789abcdef0");
// z = x.clone();
// z = bigint_uminus(x);
// z = bigint_plus(x, y);
// z = bigint_minus(x, y);
// z = bigint_mul(x, y);
// z = bigint_div(x, y);
// z = bigint_mod(x, y);
// cmp = bigint_cmp(x, y); /* return -1, 0, or 1 */
// num = bigint_number(x); /* convert normal number (may be floating) */
//

From the above interfaces , I just need to use bigint_plus and bigint_minus functions for my code.

But bigint_minus is not returning the proper subtraction for two big integers.

Attached is the BigInt.txt file , before using please rename the file to BigInt.js.apart from bigint_minus functions other functions are working fine for me.

Please let me know what is the problem with bigint_minus() function.


Thanks,

Dinesh



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum