help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Computing square-root of two [Was: Re: No subject]


From: Bård Skaflestad
Subject: Computing square-root of two [Was: Re: No subject]
Date: Fri, 17 Feb 2012 10:53:46 +0100

On Fri, 2012-02-17 at 10:24 +0100, joseph appau wrote:
> please i need help in how to find" square root of 2" in 15 significant
> figures
> 

    x = 1.5;
    x = (x + 2/x) / 2;
    x = (x + 2/x) / 2;
    x = (x + 2/x) / 2;
    x = (x + 2/x) / 2;
    fprintf('%18.15f\n', x)

Or, you can look up the 'sqrt' function in the Octave help.


Sincerely,
-- 
Bård Skaflestad <address@hidden>
SINTEF ICT, Applied Mathematics



reply via email to

[Prev in Thread] Current Thread [Next in Thread]