Skip to content

Instantly share code, notes, and snippets.

@avamsi
Created November 26, 2014 09:18
Show Gist options
  • Save avamsi/2f1601f1b1adc65664c5 to your computer and use it in GitHub Desktop.
Save avamsi/2f1601f1b1adc65664c5 to your computer and use it in GitHub Desktop.
from math import log
try:
while True:
a, b = map(int, raw_input().split('e'))
n = a * 10**b
p = 1 << int(log(n, 2))
ans = 1 + 2*(n - p)
print ans
except ValueError:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment