<p>我有一个用python实现的二进制搜索。
现在我想检查元素<code>math.floor(n ^ (1/p))</code>是否在我的二进制搜索中。
但是p是一个非常非常大的数字。我用<code>fractions module</code>写的:</p>
<pre><code>binary_search.search(list,int (n**fractions.Fraction('1'+'/'+str(p))))
</code></pre>
<p>但是我有个错误<code>OverflowError: integer division result too large for a float</code>
我怎么能取n的幂次,它是一个分数,并且做得很快?在</p>