""" Ex 2.20 from "A primer on... Reduce a number eps until the expression 1 + eps == 1 is True The last value of eps is the smallest number that can be represented on the computer. """ eps = 1.0 while 1.0 != 1.0 + eps: print("...............", eps) eps = eps / 2.0 print("final eps:", eps) """ Terminal> python machine_zero.py ............... 1.0 ............... 0.5 ............... 0.25 ............... 0.125 ............... 0.0625 ............... 0.03125 ............... 0.015625 ............... 0.0078125 ............... 0.00390625 ............... 0.001953125 ............... 0.0009765625 ............... 0.00048828125 ............... 0.000244140625 ............... 0.0001220703125 ... ............... 5.684341886080802e-14 ............... 2.842170943040401e-14 ............... 1.4210854715202004e-14 ............... 7.105427357601002e-15 ............... 3.552713678800501e-15 ............... 1.7763568394002505e-15 ............... 8.881784197001252e-16 ............... 4.440892098500626e-16 ............... 2.220446049250313e-16 final eps: 1.1102230246251565e-16 """