Commit 9ab828e5 authored by KANTAPONG SONG-NGAM's avatar KANTAPONG SONG-NGAM

week04

parent 9ecd27fe
def single prec(v):
sign = -1 if int(v[0]) == 1 else 1
return (-1)**int(v[0])*sum([int(v[i])*2**(8-i) for i in range(1,32)])
def double prec(v):
sign = -1 if int(v[0]) == 1 else 1
return (-1)**v[0]*sum([int(v[i])*2**(8-i) for i in range(1,32)])
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