unsupported operand type(s) for ^: 'float' and 'float'

F

Florian Lindner

Hello,
I get the exception above when trying to use a float as radix and exponent,
e.g.:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unsupported operand type(s) for ^: 'float' and 'float'


How can I use floats for powers?

Thanks,

Florian
 
B

benc

Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unsupported operand type(s) for ^: 'float' and 'float'

That operator... I do not think it means what you think it means.
'0x1100'

^ is the bitwise XOR operator. For exponentiation, use **.
1301.326396639844

Hope that helps,
--Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top