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
0
votes
2 answers

CLISP recursive powers of cubes function that returns a list

I'm looking for help in writing a function that returns a list of the first 15 cubes. Here's what I have so far, and I'm getting a stack overflow: (defun cubes (dec lst) ;takes a number and a list as params (if (= dec 0) lst ;if dec is 0 return…
Domn Werner
  • 572
  • 2
  • 10
  • 20
0
votes
5 answers

Custom math functions vs. supplied Math functions?

I am basically making a Java program that will have to run a lot of calculations pretty quickly(each frame, aiming for at least 30 f/s). These will mostly be trigonometric and power functions. The question I'm asking is: Which is faster: using the…
Yaakov Schectman
  • 301
  • 1
  • 2
  • 10
0
votes
2 answers

PrintPowersof2 in java

Write a method called printPowersOf2 that accepts a maximum number as an argument and prints each power of 2 from 20 (1) up to that maximum power, inclusive. For example, consider the following calls: printPowersOf2(3); printPowersOf2(10); These…
happy face
  • 43
  • 9
0
votes
1 answer

math.pow results not displaying

Trying to get math.pow function to display but it will not. The labels should the answer to 77^39 mod 517, etc.

Lizziej
  • 95
  • 1
  • 3
0
votes
2 answers

raise dict keys to the power of their value and multipy together quickly

I'm trying to take a dictionary and (1) raise each key to the power of its value, and (2) multiply together the results of (1). This needs to be done to several million rows of data. Any thoughts on how to speed up the process? I am using pandas…
JoeDanger
  • 3,325
  • 4
  • 13
  • 14
0
votes
0 answers

Import spreadsheet(excel) , retaining special characters like exponent, subscript, superscript in Ruby

We are importing an excel sheet into database in an Rails application, using Roo Gem. But it is ignoring cell format (superscript, subscript) like 54, Mathematical symbols like 1/2 etc and importing it as plain text like 54 and 1/2. Is there any way…
Vijendra
  • 338
  • 3
  • 11
0
votes
0 answers

RSA Signature - How to use Modulus and Exponent

I am trying to verify a digitally signed piece of json. I have a base64 decoded exponent and a base64 decoded modulus. I am using objective c and I seem to just be going around in circles, in java it takes roughly 5 minutes (using JOSE API's) to do…
berimbolo
  • 3,319
  • 8
  • 43
  • 78
0
votes
2 answers

Multiply a number by a ratio n times to achieve a desired number

I'm trying to scale an image down in steps so as to avoid artifacts. I have an 800 square pixel image that needs to be scaled down to 100 square pixels. I want to perform the scaling in a variable number of iterations. So lets say that I want to go…
joshontheweb
  • 612
  • 1
  • 6
  • 18
0
votes
3 answers

C++: Buoyancy program does not output as planned

I attempted to make a program that asks for the input for the radius of a sphere, and the weight of the sphere. it uses these inputs to calculate the buoyancy of the sphere and the program determines whether or not it can float in water. However, I…
0
votes
1 answer

Output powers of prime factors of a factorial

I'm trying to write a code for my class. The program has to let the user input a number and it will output the exponents of each of the prime factors of its factorial. For example, when a user inputs the number 5, the output will be 3 1 1 (2^3, 3^1,…
Jean
  • 1
  • 1
0
votes
2 answers

Python OverflowError: math range error being raised differently in different runs

My program seems to be crashing almost arbitrarily. My code includes these two lines: z[i, j] = -math.exp(oneminusbeta[j, i]) weights[i,j] = math.exp(beta[j,i] + oneminusbeta[j,i]) I've run my whole code before on data that had 2 dimensions, it was…
user961627
  • 12,379
  • 42
  • 136
  • 210
0
votes
3 answers

c change the exponent of a double

Lets say I have a double a = 0.3;. How would I be able to change the exponent of the variable, without using math functions like pow(), or multiplying it manually. I am guessing I would have to acces the memory addres of the variable using pointers,…
user1806687
  • 934
  • 1
  • 10
  • 27
0
votes
2 answers

javascript number literal using exponent

console.log(2E-12); // returns 2E-12 console.log(2E12); // returns 2000000000000 Why does line one return 2E-12 and not the same as line two. Is this an illegal way of using the exponent?
Robert
  • 10,126
  • 19
  • 78
  • 130
0
votes
2 answers

How can I do in javacard a power of 2 with a floating exponent?

I need to do a power of 2 with a floating exponent in Java Card. As you probably know, float type is forbidden in the Java Card specification. I need to do an operation like this: short n = 2 ^ (float) (31/4) The expected n is n = 215. Somebody…
0
votes
2 answers

math overflow for a not very overflowing calculation in python

The calculation for which I'm getting the math overflow number is: e2 = math.exp([[-20.7313399283991]]) There are actually more extreme numbers that I've done than this, why is this causing an overflow? I get this error: OverflowError: math range…
user961627
  • 12,379
  • 42
  • 136
  • 210