| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168703Image: ubuntu2004
Recall that languages like Matlab which use IEEE double precision cannot distinguish anything smaller than machine epsilon, which is approximately 2.2 x 10^-16. Let's see what Sage does.
it is equal to 1
1.00000000000000
This behavior shows that when the syntax NUMBER1e-NUMBER2 is used, Sage behaves just as Matlab does. Let's see what happens when we change the syntax so that 10^-20 is in rational form.
it is less than 1
99999999999999999999/100000000000000000000
One final note: the if statement behaves in much the same way as the while loop. As in python, elif is used in place of elseif.