Dolda2000 GitWeb
/
coe.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bin: Fixed float decoding bug.
[coe.git]
/
coe
/
bin.py
diff --git
a/coe/bin.py
b/coe/bin.py
index
08e521e
..
e9efc80
100644
(file)
--- a/
coe/bin.py
+++ b/
coe/bin.py
@@
-302,15
+302,15
@@
class decoder(object):
exp = self.loadint(buf)
if mnt == 0:
if exp == 0:
exp = self.loadint(buf)
if mnt == 0:
if exp == 0:
- ret
urn
0.0
+ ret
=
0.0
elif exp == 1:
elif exp == 1:
- ret
urn
-0.0
+ ret
=
-0.0
elif exp == 2:
elif exp == 2:
- ret
urn
float("inf")
+ ret
=
float("inf")
elif exp == 3:
elif exp == 3:
- ret
urn
-float("inf")
+ ret
=
-float("inf")
else:
else:
- ret
urn
float("nan")
+ ret
=
float("nan")
else:
ret = math.ldexp(mnt, exp - (mnt.bit_length() - 1))
return self.addref(ret)
else:
ret = math.ldexp(mnt, exp - (mnt.bit_length() - 1))
return self.addref(ret)