Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.
/ jq-bigint Public archive

A big integer library for working with possibly-signed arbitrarily long decimal strings.

License

Notifications You must be signed in to change notification settings

jqnpm/jq-bigint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jqnpm logotype, a Penrose triangle

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.

About

A big integer library for working with possibly-signed arbitrarily long decimal strings.

Resources

License

Stars

Watchers

Forks

Packages

No packages published