# exponentiation of 2k-bit number

Hello all,

I'm trying to to do N^(0.26) with N a 2k-bit number. And what I get is "inf" :/

N = 0x367198d6b5614e95813add8f22a4717bc72be1eabd933d1b86944fdb75b8ed230be62d7d1b69d222095c128c86f82012ecb116191fd9d018a6d02f84db27bc51a21307dc86f4bf771c691c143e5abe549b5bd2d6eb1a21fd6270e7e1b48fe0611fbb2e1b0b3524e6f4de8b4e4a345da44a13de825b72608db6c7c4a40b78266e6c87bbfdef6b48381d49c4507a58bcd47b76d64b45908b158bd7ebc4dacb0b1cfd6c2c19574f40eb2efd0e9e10dc7005cad39bcaf52b9eac3873368d69031c5e724684a44f068efd1d3dc096d9b5d6411e58bdee43e46b99a0d0494b9db28195af901aff130d4a6e203dad08da57fa7e40262a5badb2a323eda28b44696ab305d
delta = float(0.26)

print N^delta


this will print inf

edit retag close merge delete

Sort by ยป oldest newest most voted

float is a built-in Python type. When you get introduce a non-Sage type coercion kicks in and limits the precision of the calculation. Instead just set delta = .26 for the answer 2.69604638356106e160.

more

awesome! TIL

( 2016-12-15 05:33:04 +0200 )edit