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

Calculating an Exponent

In Excel =(B5/2)^2*3.141592654, where B5 is the rod. This doesn't produce the same results. $rodarea = $rod/2 ^2*3.141592654 ; What am I doing wrong? Thanks.
0
votes
2 answers

Overloaded exponents C# and exponent operator

Is there a way to overload exponents in C#? I know in some languages (can't name any off the top of my head), ^ is used for exponential functions, but in C++ and C#, ^ is the bitwise XOR operator, which can be overloaded, but this is not what I want…
Cole Tobin
  • 9,206
  • 15
  • 49
  • 74
0
votes
1 answer

Plot with an exponent x-axis

Trying to build a plot with an exponent x-axis. It should start with 0 and increasing by the power of 1.85 i.e.: tick:1 label:1000 value:3.55 tick:2 label:1500 value:7.51 tick:3 label:2000 value:12.79 tick:4 label:2500 value:19.33 tick:5 label:3000…
toy4fun
  • 839
  • 2
  • 14
  • 33
0
votes
2 answers

High power and double precision

How do you solve the below equation in some programming language of your choice? (1-1/X)^Y Easy! But how about when X & Y are very big and X>>Y e.g. (1-1/X)^Y where X = 10^40 Y = 10^12 Looks like it should be a simple enough problem, but getting…
0
votes
3 answers

Possible loss of precision when multiplying by powers?

So I was working on a simple binary to decimal script and an error occurred where there is a possible loss of precision when multiplying by a power. This is the code block in question, all it does is times the 1's and 0's in binary by 2 to the power…
jocopa3
  • 796
  • 1
  • 10
  • 29
-1
votes
1 answer

Determine if a number, n, is a power of some other number k. Return the exponent

Determine if a number, x, is a power of some other number y. Return the exponent. For example, for n = 9 and k = 3, return 2 because 3 to the power of 2 is 9. If n is not a power of k, return -1. I can't figure out how to return the exponent in this…
-1
votes
1 answer

Is there a way to find numbers which is more or less than certain exponent?

I have a code writes a robot coordination in a file. Sometimes, for an unknown reason, instead of a number like 0.01845, it writes 6.92113e-310. So I'd like to filter data raised to a power greater than -12. Is there a way to achieve this in C++?
Edvard
  • 21
  • 6
-1
votes
2 answers

Negative numbers with exponents in Python

Why does Python give me 2 different answers for the following? print(-1**2) # prints -1 print((-1)**2) # prints 1
ThePoetCoder
  • 182
  • 8
-1
votes
1 answer

How to transform XML to PDF with XSLT using exponent characters in XML

I try to print my formulas with exponents in pdf using xml, xsl and fo to transform from xml to pdf and to html. In html, i have no problem, all exponents are shown correctly. maybe because the browsers will show all utf-8 characters. but it seems…
Tom
  • 157
  • 1
  • 2
  • 8
-1
votes
2 answers

Correcting a formula in java

My first assignment requires me to write a program that expresses a formula. The formula as written in the assignment : y = 4x^3 + 8x^2 - 31x - 35 / (3x2 + 1)^1/2 + 2 * | x - 1.5 | | means absolute value; (...)1/2 means…
Jibran Khan
  • 11
  • 1
  • 6
-1
votes
1 answer

Is there a exponent operator in C?

I want to do an exponent calculation in C. I tried **, but compiler threw an error. Is there such operator in C? If not, how to calculate exponent?
Steve Wang
  • 27
  • 7
-1
votes
1 answer

Check if two numbers are powers of the same number in php

For example, since 25 and 2.2360679775 (or 5^0.5) are both powers of 5, I want the function to return 5. The only way I've found is to brute force it and just try every number. $one=25; $two=125; for($b=2;$b<=10;$b++) { $x=pow($one,1/$b); …
-1
votes
1 answer

Unsure how to type fractional equations with exponents

New to programming and have a question regarding defining an equation that is a fraction and has exponents. This is the question: Define a function tanh which, given a positive number x , returns the hyperbolic tangent of x defined as tanh(x ) =…
-1
votes
1 answer

Square negative number in go

I'm having problems to square a negative number in go... (2*(1-0.5)-4)/((4*(4-2))/(2-1))^(1/2) = -1.06066017 but with go I get NaN package main import ( "fmt" "math" ) func main() { fmt.Print(math.Sqrt((2*(1-0.5) - 4) / ((4 * (4 - 2)) /…
-1
votes
5 answers

How to solve and equation with inputs in python

I am trying to create a python program that uses user input in an equation. When I run the program, it gives this error code, "answer = ((((A*10A)**2)(B*C))*D**E) TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'". My code is:…
John smith
  • 55
  • 1
  • 7