Awesome
<p align="center"> <a href="https://github.com/joelpurra/jqnpm"><img src="https://raw.githubusercontent.com/joelpurra/jqnpm/master/resources/logotype/penrose-triangle.svg?sanitize=true" alt="jqnpm logotype, a Penrose triangle" width="100" border="0" /></a> </p>jq-bigint
A big integer library for working with possibly-signed arbitrarily long decimal strings. Written by Peter Koppstein (@pkoppstein) and released under the MIT license.
⚠️ This project has been archived
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
Usage
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.
License
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.