Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8549751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:47:27+00:00 2026-06-11T13:47:27+00:00

When I use power functions like Math.Pow(double x, double y) in C# or the

  • 0

When I use power functions like Math.Pow(double x, double y) in C# or the math.h pow-function in C++ do these run in constant time?

The reason I am asking is because I want to know if a “precalculated” bézier-function on the form (1-t)^n*p0 + … + t^(n) * pN could run in linear time which could then be faster than an implementation of De Casteljaus algorithm taking control points and t as parameters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:47:28+00:00Added an answer on June 11, 2026 at 1:47 pm

    I think that these methods use iteration based processing to get the result, and only stop when the difference between the value of two iterations fall bellow a given error-constant.

    There are iterative methods that converge very fastly to the result of a power operation… so I think they are near constant time.

    This question has a lot of great explanations:
    How is Math.Pow() implemented in .NET Framework?

    EDIT

    I have found a lot of good meterial to work with in http://math.stackexchange.com.

    • Fastest way to calculate e^x upto arbitrary number of decimals?
    • How to calculate e^x with a standard calculator
    • How can I calculate non-integer exponents?
    • Numerically estimate a^b
    • Approximation of e^(−x)

    This one is very interesting, as it explains a way of calculating exponentiation using human language:

    • How to Use a Fixed Point to Calculate an Exponentiation

    Thoughts

    I’m not a math genius, but as far as I can see, the time it takes does not depend a lot on the values you choose, but on the number of precise digits you want. What I’m trying to say is that it depends on the arguments, but there is a maximum.

    Also, to support this theory, take a look at this algorithm (implemented by Sun): http://pastebin.com/LDjS5mAR. There is no loops, only ifs. I think that it is because the guys who implemented it, chose a fixed precision they wanted… and then expanded all the iterations needed to guarantee that precision.

    For instance, a loop of invariant number of iterations can be easyly expanded like this:

    for (int it = 0; it < 5; it++)
        a *= a;
    

    Is the same as:

    a *= a; a *= a; a *= a; a *= a; a *= a;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create an Android application with real-time monitoring functions. One monitoring
I have installed TFS Power Tools and I am trying to use the powershell
Why does C++ need and use pointers? I know they add power to the
use strict; use warnings; use Time::HiRes qw(sleep); use Test::WWW::Selenium; use Test::More no_plan; use Test::Exception;
I was always wondering how I can make a function which calculates the power
Given a function R which produces true random 32 bit numbers, I would like
Here is what I'd like to do: function a() { // ... } function
I simply want to write some code that makes use of recursion of functions
Can I run a function of an extension from javascript? I installed an extension
This is the code for function that I use for setting folder permission: Public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.