- #1

seto6

- 251

- 0

## Homework Statement

ok i am using Euler's way, i have to calculate "e"=2.718281828.

my script(see below) works but it only prints up to 4 decimal places, i have no idea why, help me please, thank you in advance.

## Homework Equations

N/A

## The Attempt at a Solution

Code:

```
function [eis] = euler1(in)
c=in-1;
while c>=1,
if c == double(in-1),
Q = double(c+(c/in));
end
Q= double(c + (c/Q));
alpha = double(Q);
c=c-1;
end
eis = 2+ 1/(double(alpha));
```

Last edited: