dwayne / elm-natural Goto Github PK
View Code? Open in Web Editor NEWThe natural numbers, ℕ = { 0, 1, 2, ... }.
Home Page: https://package.elm-lang.org/packages/dwayne/elm-natural/latest/
License: BSD 3-Clause "New" or "Revised" License
The natural numbers, ℕ = { 0, 1, 2, ... }.
Home Page: https://package.elm-lang.org/packages/dwayne/elm-natural/latest/
License: BSD 3-Clause "New" or "Revised" License
The library currently has a few functions for converting to strings in different bases. It would be nice to have a more general function for converting to a List Int
in an arbitrary base (up to 2^26).
My specific use case is converting a Natural
to Bytes
(in a compact way) and back again, so:
Bytes
would be nice, but probably not worth the extra dependency.{-| Create the natural number that represents the given list of base-`b` digits.
-}
fromBase : Int -> List Int -> Natural
fromBase b digits =
Debug.todo ""
{-| Convert the given natural number to a list of digits in base-`b`.
-}
toBase : Int -> Natural -> List Int
toBase b n =
Debug.todo ""
These could perhaps be named toBaseBDigits
and fromBaseBDigits
for better consistency with the string functions.
Hi, I'm dealing with big integers and your package seems to fit well with some of my needs for handling unbounded integers with exact computations, instead of approximate for anything > 2^53.
Another common use-case I have is dealing with big integers in JSON files I may receive or send. JSON has no issue with big integers (contrary to JS) so it's common in tools I interact with to have integers > 2^53 in JSON, that are encoded as integers, and not as strings. I was wondering if you encountered similar use cases, and your general thoughts about JSON interop for elm-natural.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.