Solved

Power function that accepts real numbers

Posted on 2007-03-24
4
161 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
  • 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The greatest common divisor (gcd) of two positive integers is their largest common divisor. Let's consider two numbers 12 and 20. The divisors of 12 are 1, 2, 3, 4, 6, 12 The divisors of 20 are 1, 2, 4, 5, 10 20 The highest number among the c…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now