Commit a0dd1415 authored by Littichai Buddaken's avatar Littichai Buddaken

finished assingmentweek04

parent 67fc4d10
def single_prec(V):
"""แบบ IEE sigle precision format"""
v = list(map(int,V))
return (-1)**v[0] * sum([v[i] * 2 ** (8 - i) for i in range(1, 32)])
def double_prec(V):
"""แบบ IEE double precision format"""
v = list(map(int,V))
return (-1)**v[0] * sum([v[i] * 2 ** (8 - 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