473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

pow() function implementation

Hi,

Does anybody know how pow() function is implemented in the standard
libraries of visual c++ 6.0 ?

Thanks,
Arik
Jul 19 '05 #1
2 13037
Arik Peltz wrote:
Hi,

Does anybody know how pow() function is implemented in the standard
libraries of visual c++ 6.0 ?


Probably something like:

double pow(double x, double y)
{
return exp(y * log(x));
}

--
"Codito ergo sum"
Roel Schroeven
Jul 19 '05 #2
On Thu, 07 Aug 2003 07:46:39 GMT, Roel Schroeven <94********@sneakemail.com> wrote:
Arik Peltz wrote:
Hi,

Does anybody know how pow() function is implemented in the standard
libraries of visual c++ 6.0 ?


Probably something like:

double pow(double x, double y)
{
return exp(y * log(x));
}


In Visual C++ 7.0 this is one of the few functions for which the source
code is not provided. It's written in assembly, and is a bit more
complicated than the above would indicate... ;-)

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: david.corby | last post by:
I would like to know a few things about the pow() function. 1.) Is it an efficient way to raise a number to a given power for both small and large numbers? 2.) How accurate is pow() when doing...
13
by: Shaobo Hou | last post by:
Can anyone tell me why pow(-8.0, 1.0 / 3.0) (cubic root of -8) returns nan (in linux) and negative infinity or something (in devcpp in windows), instead of -2? The problem seems to be that pow...
52
by: Michel Rouzic | last post by:
I obtain an unwanted behavior from the pow() function : when performing pow(2, 0.5), i obtain 1.414214 when performing pow(2, 1/2), i obtain 1.000000 when performing a=0.5; pow(2, a), i obtain...
11
by: Russ | last post by:
I have a couple of questions for the number crunchers out there: Does "pow(x,2)" simply square x, or does it first compute logarithms (as would be necessary if the exponent were not an integer)?...
15
by: Mark Healey | last post by:
I'm using gcc on a fedora 3 system here are what I think the relevant lines are: #include <math.h> r=pow(2,z); When I compile I get
42
by: John Smith | last post by:
In a C program I need to do exponentiation where the base is negative and the exponent is a fraction. In standard C this would be something like t = pow(-11.5, .333), but with this combination of...
8
by: Chris Stankevitz | last post by:
Q1: Does c++ provide pow(int,int)? Q2: If not, why not? Thanks, Chris
15
by: Roman Mashak | last post by:
Hello, I'd like to make a simple replacement of 'pow()' function for the embedded platform I'm working on. What is the better way, probably bit shifting? Thanks. Best regards, Roman Mashak.
18
by: Peng Yu | last post by:
Hi, I'm wondering if there is any general guideline on when to using something like std::pow(x, n) rather than x * x * x * ... * x (n x's). Thanks, Peng
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.