delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/08/01:02:56

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 <ext DOT dieter DOT demerre AT siemens DOT be>
X-Sender: <ddemerre AT anthony DOT siemens DOT ebp DOT ii3 DOT b-rail DOT be>
To: <djgpp AT delorie DOT com>
Subject: Re: a simple question--I hope
In-Reply-To: <001101c0792f$07c74ea0$631b53d1@gei>
Message-ID: <Pine.LNX.4.30.0101080648220.27030-100000@anthony.siemens.ebp.ii3.b-rail.be>
MIME-Version: 1.0
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

-----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:

- ----<snip code>----

#include <math.h>

double myFunction(const double a, const double b)
{
  double rv;

  rv = (pow(a,2) + pow(b,2)) / sqrt(a * b);
  return rv;
}

- ----</snip code>----

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-----


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019