Skip to content

Commit 093986b

Browse files
committed
Fixed inconsistancy
1 parent 71a0842 commit 093986b

File tree

1 file changed

+3
-3
lines changed
  • contents/forward_euler_method/code/javascript

1 file changed

+3
-3
lines changed

contents/forward_euler_method/code/javascript/euler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function solveEuler(timeStep, n){
2-
const result=[];
2+
const result = [];
33
if (n != 0) {
44
result[0] = 1;
55
for (let i = 1; i < n; ++i) {
@@ -14,7 +14,7 @@ function checkResult(result, threshold, timeStep) {
1414
for (let i = 0; i < result.length; ++i){
1515
const solution = Math.exp(-3 * i * timeStep);
1616
if (Math.abs(result[i] - solution) > threshold) {
17-
console.log(result[i]+" "+solution);
17+
console.log(result[i] + " " + solution);
1818
approx = false;
1919
}
2020
}
@@ -30,6 +30,6 @@ const approx = checkResult(result, threshold, timeStep)
3030

3131
if (approx) {
3232
console.log("All values within threshold");
33-
}else{
33+
} else {
3434
console.log("Value(s) not in threshold");
3535
}

0 commit comments

Comments
 (0)