Questions tagged [exponent]

Exponentiation is a mathematical operation, written as b raised to the power of n, involving two numbers, the base b and the exponent (or power) n.

Exponentiation refers to the mathematical operation involving two numbers, one is a base and another is an exponent. It is repeated multiplication. To calculate 53 you have to multiply the number 5 (base) by itself 3 times (exponent).

588 questions
-2
votes
1 answer

How can I calculate 2^n+2^n-1+...+2^k mod 2^60 in C++, where the value of 2^i can be very big?

For a programming question I have to print the expression 2^n+2^n-1+...+2^k mod 2^60, where 1<=k
-2
votes
5 answers

I don't exactly understand this part of code

I don't understand what the code does it works im happy but i wanna understand what is it doing , im total beginner ... def raise_to_power(base_num, pow_num): result = 1 for ind in range(pow_num): result = result * base_num …
-2
votes
1 answer

How to inverse taking the n-th root

Lets just say that I have this python script: a = 2 ** 10 b = a ** # Code to reverse the process done for a. print(a) # Prints 1024 print(b) # Should print 2 How do I do this?
Person
  • 379
  • 1
  • 3
  • 15
-2
votes
1 answer

How to show an exponent in the stdout of Python program

The program runs and informs the user about the kind of the equation. So I want this to appear: "This is a: ax2+ bx + c" How can I do this in pycharm or any other IDE?
DimiDak
  • 4,820
  • 2
  • 26
  • 32
-2
votes
4 answers

Find a number to the power of another number?

I am trying to write a function in java that finds the result of an operand raised to the power of another. I can't use the pow function or any form of loop. What are any possible solutions? I tried "^" and that didn't work. public static String…
-2
votes
1 answer

I have a RSA public key exponent and modulus. How can I encrypt a string using C#?

My Public Key setMaxDigits(131); var publicKey = new RSAKeyPair('010001', '',…
Le Tung Anh
  • 811
  • 6
  • 7
-2
votes
1 answer

X86 64 AT&T using exponents for a function?

My program is trying to mock a function that uses exponents. The function is x * y^5 I have x in the register rsi, and y in the register rcx I am trying to use shlq %rsi, %rcx twice which should be y^4 then just using imulq to make it get to the…
fsdff
  • 611
  • 4
  • 10
-2
votes
1 answer

Double Exponent from user input

So my question relates to double, I am trying to get an input from the user in decimal point for any value and its exponent also in decimal point to display the result after calculation in another function where the variables will pass values as…
tryllz
  • 33
  • 1
  • 7
-2
votes
3 answers

Objective-c To the power of a negative

Write a program that evaluates the expression 3.31 × 10^(-8) + 2.01 × 10^(-7) ÷ 7.16 × 10^(-6) + 2.01 × 10^(-8) Answer float result; result = (3.31 * 10.0e + 2.01 * 10.0e-8) / (7.16 * 10.0e-6 + 2.01 * 10.0e-8); NSLog(@"%e",result); This is the…
user5699271
-2
votes
1 answer

What is the expression, var=1.e12?

I have been trying to understand a FORTRAN code, which has the following expression: var=1.e12 What is the meaning of this expression and its equivalent in FORTRAN 90/95
-2
votes
2 answers

Why my squared numbers won't get printed?

def square(x): x = 2**x x = 2.0 while x < 100.0: print x, '\t', square(x) x = square(x) I tried to print. But it won't print. What I actually wanted were the squares of 2. But it won't be printing? What am I doing wrong?
praneet
  • 45
  • 6
-2
votes
4 answers

Exponent not working properly in C

When i run the following code /*Program to find the greatest common divisor of two nonnegative integer values*/ #include int main(void){ printf(" n | n^2\n"); printf("-----------------\n"); for(int n = 1; n<11; n++){ …
Justin
  • 547
  • 3
  • 7
  • 15
-3
votes
2 answers

without factorial function to do exponent approximation in python

Use loops to write a program that computes the value of by using the following formula. e ^ x = 1+x/1!+x^2/2!+x^3/3!+ ... Notice that do not import factorial function in math module. Sample answers:e=2.71828 and e^2=7.389056
Ken
  • 9
  • 1
-3
votes
1 answer

Writing a exponent function Without POW or Multiplication

Im trying to Write a function that accepts two input parameters and computes the result of raising the value of the first input to the value of the second input, and returns the result. You are not allowed to use the multiplication operator(*)for…
Shadow
  • 1
  • 4
-3
votes
3 answers

n power n print 'Hello World' without calculating the value

I want to print Hello World n**n times without calculating the value of n**n in python. eg, if n is 2, it should print 'Hello World' 4 times. if n is 3 it should print 'Hello World' 27 times and so on. I am allowed to use loops and recursion but…
binu.py
  • 1,137
  • 2
  • 9
  • 20