1

Has anyone else used the Decimal module in python?

And if so do you know why it returns
"AttributeError: type object 'decimal.Decimal' has no attribute 'power'"?

According to the documentation
https://docs.python.org/3/library/...

...theres a power() function.

Doing

decimal.power()
Decimal.power()
power(x, y)

No matter how I call it, it always returns an error indicating power() doesn't exist and I'm scratching my head.

Comments
  • 3
    Skimming through the docs, I see the power() method belongs to the decimal.Context class, it's not a global function in the decimal module or a method of a decimal.Decimal class.
    The description even shows the Context.power() function being called.

    Look at the beginning of the 'Context objects' section to figure out how to work with those.
  • 3
    @endor welp...I'm retarded.

    Thank you endor.
  • 1
    More meth, @Wisecrack?
  • 1
    @Root always Root.

    Meth is life. Meth is love.
Add Comment