Mail Archives: djgpp/1999/04/21/05:59:41
> 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).
- Raw text -