A big integer library for working with possibly-signed arbitrarily long decimal strings. Written by Peter Koppstein (@pkoppstein) and released under the MIT license.
No future updates are planned. Feel free to continue using it, but expect no support.
This is a package for the command-line JSON processor jq
. Install the package in your jq project/package directory with jqnpm
:
jqnpm install joelpurra/jq-bigint
import "joelpurra/jq-bigint" as BigInt;
# BigInt::negate: # . * -1
# BigInt::lessOrEqual(x; y): # x <= y
# BigInt::long_add(x;y): # x+y
# BigInt::long_minus(x;y): # x-y
# BigInt::long_power(i): # .^i
# BigInt::long_multiply(x;y): # x*y
# BigInt::long_divide(x;y): # x/y => [q,r]
# BigInt::long_div(x;y): # integer division
# BigInt::long_mod(x;y): # %
# In all cases, x and y must be strings; . and i should be an integer or a string.
Copyright (c) 2014, 2015 Peter Koppstein https://github.com/pkoppstein and Joel Purra https://joelpurra.com/ All rights reserved.
When using jq-bigint, comply to the MIT license. Please see the LICENSE file for details.