Sqrt VS Pow

Hello, I just wanted to ask about the processing times mentioned in video. Gary said that it is way faster to use Pow that Sqrt, however appliance in code showed the opposite. Can you please clarify?

Also tested it on my PC: Pow took around 5 seconds, whereas Sqrt took 1 second to process:

    for(int i=0;i<100000000;i++) 

    for(int i=0;i<100000000;i++)
    return 0; 

When equations become more complex, pow is faster than sqrt. This is the case since it is easier to calculate for example the chain rule (when you have some partial derivatives or so).

Kind regards, Lisa


This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.