Skip to content

Commit 4b74f96

Browse files
committed
Lecture 05 (floating point arithmetic)
1 parent 2ca3509 commit 4b74f96

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

05/fp.odp

52.5 MB
Binary file not shown.

05/fp.pdf

247 KB
Binary file not shown.

05/loop.c

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <stdio.h>
2+
3+
int main(void)
4+
{
5+
double d;
6+
double dmin = 9007199254740990;
7+
double dmax = dmin + 10;
8+
printf("dmin = %lf\n", dmin);
9+
printf("dmax = %lf\n", dmax);
10+
for (d = dmin; d < dmax; d += 1)
11+
printf("%lf\n", d);
12+
return 0;
13+
}

05/loop.math.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
vmin = 9007199254740990.0
2+
vmax = vmin + 10.0
3+
v = vmin
4+
while v < vmax:
5+
print(v)
6+
v += 1.0

05/loop.numpy.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import numpy as np
2+
3+
vmin = 9007199254740990.0
4+
vmax = vmin + 10.0
5+
for v in np.arange(vmin, vmax, 1.0):
6+
print(v)
7+

0 commit comments

Comments
 (0)