Package

purescript-bigints

Repository
purescript-contrib/purescript-bigints
License
MIT
Uploaded by
pacchettibotti
Published on
2026-10-11T13:45:42Z

Latest release Build Status Maintainer: gbagan

Note: This package is deprecated. You probably want to use purescript-js-bigints instead.

A library for calculations with arbitrary length integers. This is a simple wrapper around BigInteger.js by Peter Olson.

Module documentation

Example

x = fromInt 42
y = (fromJust <<< fromBase 16) "fe45aab12"
mersenne10 = (fromInt 2) `pow` (fromInt 89) - one

> x `pow` x
fromString "150130937545296572356771972164254457814047970568738777235893533016064"

> toNumber (y * mersenne10)
4.2248205181941055e+37

> prime mersenne10
true

Installation and usage

You can install this package via Spago. You will also need BigInteger.js, which can be installed via npm:

spago install bigints
npm install big-integer

For the browser, remember to bundle BigInteger.min.js with your code.

Development

npm install
spago build
spago test

Use spago docs to generate the documentation.

Modules
Data.BigInt
Dependencies