Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

power of number

double Pow(double x, int n) 
{
  double ans=1.0;
  while(d>0)
  {
    if(d&1==1)
      ans*=x;
    d>>=1;
    x*=x;
  }
  return ans;
}
Comment

power of a number

#include <iostream>
using namespace std;

long long binpow(long long a, long long b) {
    if (b == 0)
        return 1;
    long long res = binpow(a, b / 2);
    if (b % 2)
        return res * res * a;
    else
        return res * res;
}

int main()
{
    long long x = 5;
    long long y = 16;
    
    cout << "Power is " << binpow(x, y);
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# close program 
Csharp :: make variables in c# 
Csharp :: upload file using httpwebrequest c# 
Csharp :: how to add rigidbody in unity 
Csharp :: c# string slice 
Csharp :: how to destroy parent gameobject unity 
Csharp :: c# get serial ports 
Csharp :: how to concatenate two arrays in c# 
Csharp :: maclaurin series 
Csharp :: quotes in string f# 
Csharp :: bsod screen c# 
Csharp :: unity tilemap get all tiles 
Csharp :: how to evaluate code in c# 
Csharp :: how to find the multiples of 3 c# 
Csharp :: c# remove the last character of a string 
Csharp :: System.Drawing get from url 
Csharp :: c# read double 
Csharp :: unity activate gameobject via script 
Csharp :: c# xml comment type reference 
Csharp :: check file lock c# 
Csharp :: why is called c# 
Csharp :: enable cors asp.net mvc 
Csharp :: unity agent look at 
Csharp :: List C# add from List 
Csharp :: c# if isset 
Csharp :: timer unity 
Csharp :: math with c sharp 
Csharp :: checkbox in c# 
Csharp :: iterate through photon player gameobjects 
Csharp :: c# read excel file into datatable 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =