www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/21/01:27:26

From: "Todd Steury" <steu4718 AT uidaho DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: how to write exponents?
Lines: 21
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <ZFdT2.478$h35.4939@newsfeed.slurp.net>
Date: Tue, 20 Apr 1999 22:53:47 -0700
NNTP-Posting-Host: 208.26.209.238
X-Trace: newsfeed.slurp.net 924673785 208.26.209.238 (Wed, 21 Apr 1999 00:49:45 CDT)
NNTP-Posting-Date: Wed, 21 Apr 1999 00:49:45 CDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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


- Raw text -


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