Closed Unisay closed 7 years ago
At the moment, its possible to parse a string representation of a base-n encoded number using fromBase :: Int -> String -> BigInt
fromBase :: Int -> String -> BigInt
However, its not currently possible to go other way around, from BigInt to its base-n representation (only decimal base is supported via toString)
toString
So, having a method toBase :: Int -> BigInt -> String would be quite useful and make things isomorphic.
toBase :: Int -> BigInt -> String
Sounds good!
Looks like this is supported by the underlying JavaScript module: https://github.com/peterolson/BigInteger.js#tostringradix--10
https://github.com/sharkdp/purescript-bigints/pulls
At the moment, its possible to parse a string representation of a base-n encoded number using
fromBase :: Int -> String -> BigInt
However, its not currently possible to go other way around, from BigInt to its base-n representation (only decimal base is supported via
toString
)So, having a method
toBase :: Int -> BigInt -> String
would be quite useful and make things isomorphic.