Questions tagged [eulers-number]

Euler's number (usually denoted e in mathematics) is a transcendental constant approximately equal to 2.718281828. It is the base of natural logarithms.

The mathematical constant e (wikipedia) can be defined in various equivalent ways:

  • the unique positive real number such that the derivative of the function f(x) = ex is always equal to ex
  • the unique positive real number such that the derivative of the function loge x = 1 / x
  • the limit as n tends to infinity of (1 + 1/n) ^ n
  • the sum of the infinite series 1 / n! as n goes from zero to infinity

Ths first of these accounts for the frequency with which e crops up in models involving compounded growth.

64 questions
0
votes
2 answers

Euler's number with stop condition

original outdated code: Write an algorithm that compute the Euler's number until My professor from Algorithms course gave me the following homework: Write a C/C++ program that calculates the value of the Euler's number (e) with a given accuracy of…
max
  • 166
  • 13
0
votes
2 answers

Write an algorithm that compute the Euler's number until

My professor from Algorithms course gave me the following homework: Write a C/C++ program that calculates the value of the Euler's number (e) with a given accuracy of eps > 0. Hint: The number e = 1 + 1/1! +1/2! + ... + 1 / n! + ... = 2.7172 ...…
max
  • 166
  • 13
0
votes
1 answer

Getting a slice of a float from an irrational number

I am trying to find a way to slice an arbitrary index of an irrational number, eg. getting a slice of 5 digits of the Euler's number starting at the decimal index 100. This is not a practical task, just a thing I was wondering about. I was trying to…
0
votes
1 answer

Scaling euler number in Pandas Column

I have a pandas dataframe with one column that has euler numbers inside. E.g. 5.589918e+08 5.572475e+08 8.639290e+09 Whats the best way to scale the whole column to normal numbers?
Russgo
  • 104
  • 6
0
votes
1 answer

differentiating the SEIR model in Java

I'm attempting to make a simulation of the SEIR epidemic model. It contains four parts: Susceptibles (non-infected) Exposed (infected but not infectious yet) Infectious (infected and infectious) Removed (recovered/dead) where gamma γ is the…
0
votes
1 answer

Plotting solution 2nd ODE using Euler

I have used the Equation of Motion (Newtons Law) for a simple spring and mass scenario incorporating it into the given 2nd ODE equation y" + (k/m)x = 0; y(0) = 3; y'(0) = 0. Using the Euler method and the exact solution to solve the problem, I have…
C.L
  • 17
  • 4
0
votes
1 answer

Issue finding euler's number in java

i have to find e, which is 1/0! + 1/1! + 1/2! + 1/3!... + 1/n! given n as a parameter and i'm having trouble getting the correct answer. public double Factorial(int n) { long fact = 1; for (int i = 1; i <= n; ++i) { fact…
Alex
  • 55
  • 6
0
votes
0 answers

Python: Using 'getcontext().prec' from the decimal module for controling the number of digits prinited of an infinite number

I am working on a project that generates an infinite number like PI (3.141...etc) or Euler's number(2.718...etc). It asks the user how many digits they would like to generate then runs an algorithm that will accurately generate that many…
0
votes
3 answers

How to calculate 37 decimals of Euler's Number in C?

I have the following code and it returns: 2.7182818284590455348848081484902650118 where only 2.718281828459045 is right and the rest is wrong. I'm using the following reference: 2.7182818284590452353602874713526624977…
Brayan Angarita
  • 307
  • 2
  • 12
0
votes
0 answers

Using Euler's method to graph in MATLAB

I'm having some trouble with this code. My professor asked us to create a function "feuler.m" in MATLAB to solve the initial-value problem given by the differential equation u′(t) = (2+2t)e^t and the initial condition u(0) = 0 over the interval [0,…
0
votes
2 answers

Java: BigDecimal erroneously gives divide-by-0 error

I'm trying to calculate Euler's number to a high degree of accuracy using BigDecimals but after a while, the numbers get so small that the JVM throws a divide-by-0 error. Any ideas on how to overcome? I find that the try-catch block is always called…
Ryhun
  • 3
  • 1
  • 4
0
votes
1 answer

How can I see the total number of edges and/or Genus in an imported OBJ file using Meshlab?

Is there any way to see the total number of edges and/or the genus used in the euler number formula using MeshLab? (source: 80.lv)
Rex Buyeo
  • 13
  • 2
0
votes
1 answer

Euler's number using a recursive function in C

I am trying to make a program in C that uses a recursive function to calculate the factorial for Euler's number, and sends that data to main where the recursive function is to stop once two successive values have a difference of 0.0000001, however i…
T.Steele
  • 1
  • 1
  • 2
0
votes
2 answers

Why my method to get euler numbers, return infinity?

Im trying to get the euler number, with Javascript. Here my code, that return infinity: function euler_number() { for(var j = 0, e = 0; j < 10; j++) { e += 1/(factorial(j)); } return e; } function factorial(n) { if(n <= 1)…
ESCM
  • 269
  • 2
  • 13
0
votes
1 answer

Scheme / Drracket Euler Number

I am Trying to implement a Euler number in drracket aka Scheme. i saw a solution by means of the search function but it is way to complex. (define (fakultät n) (cond [(= n 0) 0] [(= n 1) 1] [else (* (fakultät (- n 1)) n)])) (define (e…
user9163844