Commit 507f700a authored by wongkai junttajit's avatar wongkai junttajit

seng job

parent c35b89e6
......@@ -2,11 +2,11 @@
def single_prec(v):
return (-1) **int(v[0]*sum([v[i] * 2 ** (8 - i) for i in range(1,32)]))
return (-1)**int(v[0])*sum([int(v[i])*2**(8-i) for i in range(1,23)])
def double_prec(v):
def double_prec(v,):
return (-1)**int(v[0]*sum([v[i] * 2 ** (11 - i) for i in range(1,63)]))
v+="0"*(64-len(v))
return (-1)**int(v[0])*sum([int(v[i])*2**(11-i) for i in range(1,64)])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment