Solved

Power function that accepts real numbers

Posted on 2007-03-24
4
167 Views
Last Modified: 2010-04-01
I need an algorithm or C++ pseudo code for exponentiation with real numbers, i.e. 2^3.5.

Thanks
0
Comment
Question by:gromul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 18787436
#include <math.h>
pow(2.0,3.5);
0
 

Author Comment

by:gromul
ID: 18787444
I got that, but how would I code this function myself?
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 18787474
exp(log(2.0)*3.5)
0
 
LVL 84

Expert Comment

by:ozo
ID: 18787475
2*2*2*sqrt(2)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
When there is a disconnect between the intentions of their creator and the recipient, when algorithms go awry, they can have disastrous consequences.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question