Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we do very large number math? #193

Open
marcopaganini opened this issue Nov 2, 2024 · 0 comments
Open

How can we do very large number math? #193

marcopaganini opened this issue Nov 2, 2024 · 0 comments

Comments

@marcopaganini
Copy link

Hello,

I'm working on a CLI RPN calculator using this awesome library, but I'm hitting a roadblock.

In dc, when we do something like: 2 1234567 ^ p, we (expectedly) get a very large number. However, when I try do to the same using decimal:

ctx = decimal.ContextUnlimited
z = decimal.WithContext(decimal.ContextUnlimited)
ctx.Pow(z, bigUint(2), bigUint(1234567))
fmt.Printf("%s\n", z)

I get NaN13, and nothing else.

Is is possible to use this library for very large numbers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant