X-Authentication-Warning: anthony.siemens.ebp.ii3.b-rail.be: ddemerre owned process doing -bs Date: Mon, 8 Jan 2001 06:51:53 +0100 (CET) From: Dieter Demerre X-Sender: To: Subject: Re: a simple question--I hope In-Reply-To: <001101c0792f$07c74ea0$631b53d1@gei> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 7 Jan 2001, Pamela and Richard Groh wrote: > To Whom It May Pertain: > > I am a new beginner a C++ programming and I am trying to > create a program to perform the following equation and am > stuck, can you give me any clues or send a similar editor > file copy for me to compare. > > a times a plus b times b divided by square root > (a*a + b*b /sqrt) I Guess you forgot to mention divided by square root _of what_ Anyhow, try this one, assuming you want square root of a times b: - -------- #include double myFunction(const double a, const double b) { double rv; rv = (pow(a,2) + pow(b,2)) / sqrt(a * b); return rv; } - -------- good luck ! - -- Groetjes vanwege... Greetings from... -- - -- Dieter Demerre *** ddemerre AT acm DOT org -- - -- http://www.angelfire.com/de/ddemerre/ -- -----BEGIN PGP SIGNATURE----- Version: PGP 6.5.8 iQA/AwUBOllVnAlG34XnM6kpEQLNqwCfTmwlrR5RtUdvdPCUMVgnWND2FR0AoMZD cn0t9oN1b4vceIjW51akr7Lp =ZRpU -----END PGP SIGNATURE-----