Skip to content
/ bn Public

Cross-platform arbitrary precision integers

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.md
MIT
LICENSE-MIT.md
Notifications You must be signed in to change notification settings

NuID/bn

Repository files navigation

nuid.bn

Cross-platform arbitrary precision integers.

Requirements

jvm, node + npm, clj, shadow-cljs

Clojure and ClojureScript

tools.deps:

{nuid/bn {:git/url "https://github.com/nuid/bn" :sha "..."}}

usage:

$ clj # or shadow-cljs node-repl
=> (require '[nuid.bn :as bn])
=> (def a (bn/from "42"))
=> (def b (bn/from "14159265358979323846264338327950288419716939937510"))
=> (def c (bn/add a b))
=> (bn/eq? a b)  ;; => false
=> (bn/lt? a b)  ;; => true
=> (bn/str c)    ;; => "14159265358979323846264338327950288419716939937552"
=> (bn/str c 16) ;; => "9b02b6aef2f4c6d5f1a5aae08bf77321e33e47710"

Licensing

Apache v2.0 or MIT

Releases

No releases published

Packages

No packages published