Skip to content

Commit

Permalink
accepting floats for recursion sheet0
Browse files Browse the repository at this point in the history
  • Loading branch information
domonik committed Oct 23, 2023
1 parent 45e2989 commit ce1fa61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/js/recursions.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function linearRecursion(a0, d, x) {
}

const sequence = [a0];

console.log(x)
for (let n = 1; n < x; n++) {
const an = sequence[n - 1] + d;
sequence.push(an);
Expand All @@ -65,7 +65,7 @@ function linearRecursion(a0, d, x) {

function checkLinearRecursion() {
const a0 = parseFloat(document.getElementById("linRecA0").value);
const x = parseInt(document.getElementById("linRecX").value);
const x = parseFloat(document.getElementById("linRecX").value);
const d = parseFloat(document.getElementById("linRecD").value);
const lrtable = document.getElementById('lin-rec-table');
const expected = linearRecursion(a0, d, x);
Expand Down

0 comments on commit ce1fa61

Please sign in to comment.