diff --git a/.idea/Numerical.iml b/.idea/Numerical.iml
index 4f21c2d..d06e659 100644
--- a/.idea/Numerical.iml
+++ b/.idea/Numerical.iml
@@ -2,7 +2,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..d821048
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index cd9d35b..0a82ef1 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,5 +1,12 @@
+
+
+
+
+
+
+
@@ -10,5 +17,11 @@
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml
new file mode 100644
index 0000000..922003b
--- /dev/null
+++ b/.idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index a39b29c..2bc51f9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -11,8 +11,8 @@
-
-
+
+
@@ -24,18 +24,24 @@
+
+
+
- 1434792298659
- 1434792298659
+
+
+
diff --git a/chap1/1_3_infiniteseries.py b/chap1/1_3_infiniteseries.py
index 4c4ed0b..3b6d040 100644
--- a/chap1/1_3_infiniteseries.py
+++ b/chap1/1_3_infiniteseries.py
@@ -1,7 +1,7 @@
__author__ = 'chunk'
import struct
-
+import numpy as np
def float2bits(f, fmt='bin'):
if fmt == 'hex':
@@ -30,14 +30,13 @@ def double2bin(num):
def infiniteseries():
- s = 0
- tmp = -1
+ s = np.float32(0)
+ tmp = np.float32(-1)
i = 0
- while float(s) != float(tmp):
+ while s != tmp:
i += 1
tmp = s
- s += float(1.0 / i)
- print tmp,s
+ s += np.float32(1.0 / i)
print i, s, tmp
--
libgit2 0.21.2