Skip to content

How can we do very large number math? #193

@marcopaganini

Description

@marcopaganini

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions