Write C programs to implement the reality we discussed last week. See the details of reality in the lecture notes: reality_1 on page 4, reality_3 on page 8 and reality_4 on page 12.
$ reality 5 reality_1_example_1_float: f=50000.000000 f*f=2500000000.000000 >= 0 reality_1_example_1_int: i=40000 i*i=1600000000 >= 0 reality_1_example_1_int: i=50000 i*i=-1794967296 < 0 reality_1_example_2_unsigned: uix=12 uiy=34 uiz=56 ((uix+uiy)+uiz)=102 == (uix+(uiy+uiz))=102 reality_1_example_2_signed: six=12 siy=34 siz=56 ((six+siy)+siz)=102 == (six+(siy+siz))=102 reality_1_example_2_float: fx=1.000000e+20 fy=-1.000000e+20 fz=3.140000 ((fx+fy)+fz)=3.140000e+00 != (fx+(fy+fz))=0.000000e+00 reality_3: n=5 iterations fun(0) -> 3.140000 fun(1) -> 3.140000 fun(2) -> 3.140000 fun(3) -> 2.000001 fun(4) -> 3.140000 Segmentation fault (core dumped) $
$ reality4 copyij(): dim=2048: elapsed=0.13 secs copyji(): dim=2048: elapsed=0.97 secs $