Message-Id: <199904211034.OAA23161@ape.school.ioffe.rssi.ru> From: Vladimir Mosgalin Subject: Re: how to write exponents? In-Reply-To: from Todd Steury at "Apr 20, 1999 10:53:47 pm" To: djgpp AT delorie DOT com Date: Wed, 21 Apr 1999 13:33:40 +0400 (MSD) X-Mailer: ELM [version 2.4ME+ PL48 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Hey all, > > I'm using C++ and the djgpp compiler to write mathematical models. For > exponents, I've written my equations as "a^b" to signify 'take a to the b > power'. However, the compiler complains "invalid operands 'float' and > 'double' to binary 'operator ^'". What is the proper mathematical operator > for exponent? If '^' is the proper operator, then what am I missing? A > sample line of code might be: > > numberFemales = survival^0.226175; > > where all variables are initialized as float, double, or long double. > Please send responses to e-mail: > > steu4718 AT uidaho DOT edu > > Thanks > > Todd Steury > > You can use pow(a, b).