double a,b;
printf("%f",a^b);

error occurs as shown in heading.
any alternative method?

Recommended Answers

All 4 Replies

Before looking for ways to do this, maybe you should consider why you want to do it in the first place. Bitwise operations not working on floating-point isn't much of an issue because most of the time it's nonsensical.

commented: i usually get good replies from narue +1

by a^b i mean 'a raised to b' (bth power of a). not bitwise operations.

Where you got the idea ^ means raised to the power in C is a great question.

Belaying that, look in the math.h header for the function pow()

thanks... i was converting matlab to c. so didnt notice...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.