how to convert this psuedo code to python

Max Zettlmeißl max at zettlmeissl.de
Fri Sep 14 09:17:23 EDT 2018


On Fri, Sep 14, 2018 at 2:37 PM, Noel P. CUA <npcua at donbosco.edu.ph> wrote:
>  compose your own octave script to calculate the machine
> epsilon. Analyze the code.
>
> epsilon = 1
> DO
> IF (epsilon+1<=1) EXIT
> epsilon = epsilon/2
> END DO
> epsilon = 2 x epsilon
>

epsilon = 1

while epsilon + 1 > 1:
    epsilon = epsilon / 2.0

epsilon = 2 * epsilon


This will not work in Octave. But maybe it will help you in improving
your understanding of the solution.



More information about the Python-list mailing list