When I enter float(1)/(2^7) in the Python console it outputs 0.2. But it is actually 0.0078125.
Could anyone please tell what I am doing wrong?
When I enter float(1)/(2^7) in the Python console it outputs 0.2. But it is actually 0.0078125.
Could anyone please tell what I am doing wrong?
You probably want to use the **
operator instead of ^
. **
is the power operator in python, ^
is the Binary XOR operator.
float(1)/(2**7)
yields the correct 0.0078125
.