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
-3
votes
1 answer

Rounding a double value With Exponent

I have a double value 0.000034 for example and I want a double value 3.40E-5 (please note that the second value required is also a double value and not string). All the results I have found so far convert the value to the string format which is not…
-3
votes
1 answer

How to use exponent in emacs?

I'm new here and new to programming as I've recently enrolled in a Computer Science course. My question is: how do you denote raising an integer "x" to the "y" power? I have searched online and have found the command expt however I am unsure of…
Jesus
  • 23
  • 2
-3
votes
2 answers

Exponents in C (n^m)

http://z-trening.com/tasks.php?show_task=5000000069&lang=uk #include int main(void) { long long o, s, m, i; long long rez = 1; scanf("%lld %lld %lld", &o, &s, &m); o = o % m; for (i = 0; i < s; i++){ rez =…
user31415
  • 19
  • 1
  • 6
-4
votes
1 answer

Why does this python statement got stuck?

Have anyone ever experienced this statement? The following code looks work well, but it makes my laptop get stuck when the exponent reaches 9 or above. ordered_tuple = tuple(range(10**9)) Every time I run this statement, my laptop slows down, got…
dark horse
  • 3
  • 1
  • 2
-4
votes
1 answer

Zero Subsequences problem - What's wrong with my C++ solution?

Problem Statement: Given an array arr of n integers, count the number of non-empty subsequences of the given array such that their product of maximum element and minimum element is zero. Since this number can be huge, compute it modulo 10 ^ 9 + 7 A…
hecker
  • 9
  • 4
-4
votes
1 answer

Could anyone tell clearly how to find the exponents with fractional values or decimal values without using pre-defined function like ?

ex:2^0.5=1.414....&so want. I'm newbie to c so please explain simple logic if not complicated logic is also enough
-4
votes
1 answer

How do I convert a decimal exponent like e+308 (in base 10) to a hexadecimal number with equivalent magnitude?

Say, I have the number 0.1e+308. How can I take the exponent 308 (which is base 10), and find the correct exponent in hexadecimal (base 16)? I don't simply mean convert 308 to hexadecimal. - That's easy! I want to find the equivalent hexadecimal…
c0ax
  • 1
  • 1
-4
votes
1 answer

Derby built in functions

How do I calculate equivalent POWER(base, exponent) function in Apache Derby using SELECT statement?
M. Cookies
  • 19
  • 1
-4
votes
1 answer

Given an integer, w, find n and k such that n^k = w

I'm working on a Uva problem (#107) and I know I have the right answer, and now I just need to optimise it so it doesn't time out. I believe this snippet is the culprit. I need to find n and k such that n^k = working. I tried making my own power…
-4
votes
3 answers

Inverting the exponent of a long double gives me an insane result

I am trying to invert the exponent of a long double. Suppose x = 3.5e1356. I want x to be 3.5e-1356. I have this code: long double x = 3.5e1356L; int exponent; long double fraction = frexpl(x, &exponent); // recreate number with an inverted…
Duck
  • 34,902
  • 47
  • 248
  • 470
-4
votes
1 answer

Haskell - Is it possible to take 2 ints and find a common exponent?

Lets say i want to find if the relation between the amount of possible triangles with integer angles and quadrilaterals with integer angles can be represented by an exponent. like say T is triangles and Q is quadrilaterals Q = T^x Is there a…
jaw2233
  • 161
  • 6
-4
votes
1 answer

Javascript Exponents in HTML

I need to create a JavaScript function that uses input=number to pass it to a JavaScript function to raise it to 2nd, 3rd, 4th, and 5th powers. So far I can pass a number to it and out put that number, but can not seem to grasp the math.pow and also…
-4
votes
1 answer

Recursive Exponent Method stack overflow

I already searched everywhere for a solution for my problem, but didn't get one. So what I'm trying to do ist use recursion to find out whats a passed integer variable's base to the power of the passed exponent. So for example 3² is 9. My solution…
-4
votes
2 answers

How this formula is deriving 2^N + 2^N = 2^(N+1)

If the bases are same and variables are adding , then it becomes like this ^ represent power X^N + X^N = 2X^N not X^2N like we take common X^N(1 + 1) = 2X^N but in the case 2^N + 2^N = 2^(N+1) if we take common 2^N(1 + 1) = (2)2^N How it is…
Basit
  • 8,426
  • 46
  • 116
  • 196
-5
votes
1 answer

Taking power with loop(with-out pow() function)

Im trying the powers of an integer. For example if my integers is 2 first 10 power is 2^1,2^2...2^10. Im using while (expnt < 10) { preExpnt = expnt; while (preExpnt) { preExpnt *= num; printf("%lld\n", preExpnt); } …
1 2 3
39
40