Questions tagged [exp]

The Exponential - aka exp(x) function

The vast majority of the 21 posts tagged [exp] relate to the Exponential function i.e. f(x) = e^x where e is the number which is approximately 2.71828. This function is very important in statistics and many other fields.

235 questions
0
votes
1 answer

How to find antilogarithm for large values?

I want to know how to find antilogarithm of a float. My first approach was to use built-in functions like exp(), pow() both in Python & C, but they gave out of range error. Then I tried to break It in two parts, one integer & other float, then…
0
votes
0 answers

Asp textbox treat its content as number instead of text

I wish to show a large string in an asp:TextBox. The string is just series of numbers, but i wish to treat it as a text. Currently ASP tries to be clever and the textbox shows 2.10002e+006 instead of 210001800230... Is there a way to control…
0
votes
1 answer

how does the program shows so large number

I have a question,maybe it's stupid.I wrote that code to calculate expontiation : #include int i=0; float power(int a,int b); main() { int base,exp; printf("Base:\n"); scanf("%d",&base); printf("Exp:\n"); …
user3488767
0
votes
1 answer

Wrong result in C

I want to write a program that calculates expontiation using the Gauss' algorithm but if give input etc base=2,exp=50 i get as a result 0.0000. #include float fastpower(int a,int b); main() { int base,exp; …
user3488767
0
votes
1 answer

std::exp giving different result than MATLAB exp for complex number

I'm copying a script from matlab into a c++ function. However, I constantly get different result for the exp function. For example, following snippet: std::complex final_b = std::exp(std::complex(0, 1 * pi)); should be equivalent to…
spurra
  • 1,007
  • 2
  • 13
  • 38
0
votes
2 answers

Matlab, exp function overflow

Can anyone suggest how can I find the largest value for which the function exp in Matlab doesn't overflow, and the smallest for which it overflows. Thank You!
Iulian Rosca
  • 1,005
  • 4
  • 15
  • 30
0
votes
2 answers

double exp(double) unexpectedly returns NaN (no float overflow)

I've been working on implementing black-body radiation according to Planck's law with the following: double BlackBody(double T, double wavelength) { wavelength /= 1e9; // pre-scale wavelength to meters static const double h = 6.62606957e-34; //…
petiaccja
  • 171
  • 6
0
votes
1 answer

How do I use sed to replace decimal exponential values with 0 in a data file

My problem is that in among a column of data there are a few values that are exponentials, usually in the form of 2.796e-05. The decimal value in front of the 'e' always varies but it seems like its always to e-05. So what i've been trying so far…
0
votes
1 answer

Where can I find a good implementation of exp(double) using SSE2 instructions on x86/x64?

I've established that the Microsoft implementations of exp(double) in the VS2010 C library use different algorithms on Win32 (i.e. 32-bit x86) and x64 platforms, even though I've enabled SSE2 for the x86 platform and verified that the SSE2 code path…
dc42
  • 314
  • 3
  • 6
0
votes
1 answer

Exponentiation of a large floating point imaginary argument

How do I go about calculating exp(i * x) where |x| >> 2 pi? I know that it can be done with an arbitrary precision library, but is there an algorithm to do it stably (without roundoff errors) that doesn't require a library?
Andrew Spott
  • 3,457
  • 8
  • 33
  • 59
0
votes
2 answers

Floating point numbers precision

Possible Duplicate: Precision of Floating Point I am trying to calculate the probability using some floating point numbers but always my final result is coming out as zero. Please find the below code and examples. sd_attr4_ok =…
Teja
  • 13,214
  • 36
  • 93
  • 155
0
votes
2 answers

PHP MySql Progress Bar

Possible Duplicate: Progress bar layout using CSS and HTML I'm making a game that involves energy, EXP, level, missions, etc. Well, When you do missions it costs energy and you recieve cash and EXP once you do a mission. Well, it requires EXP to…
-1
votes
1 answer

Numpy exp() function gives me wrong value for no reason

import matplotlib.pyplot as plt #from numpy.fft import fft as numpyfft #from scipy.fftpack import fft as scipyfft import numpy as np print(np.exp([-2j*np.pi])) print(np.exp([-2.j*np.pi])) print(np.exp(-2j*np.pi)) …
-1
votes
1 answer

Looping through a file and calculate logarithm and exponential function

I have a simple text file containing some negative values: sample.txt -61.68 -69.00 -90.93 -95.25 Need to calculate following mathematical operation: result1 = exp(ln(10)* -61.68/10) result2 = exp(ln(10)* -69.00/10) + exp(ln(10)* -90.93/10) +…
arcangel
  • 11
  • 2
-1
votes
1 answer

fast double exp2 function in C

I need a version of the following fast exp2 function working in double precision, can you help me ? Please don't answer saying that it is an approximation so a double version is pointless and casting the result to (double) is enough..thanks. The…
elena
  • 233
  • 1
  • 7
1 2 3
15
16