Skip to content

Commit

Permalink
Define symbol early enough for use in math
Browse files Browse the repository at this point in the history
  • Loading branch information
sogaiu committed Nov 25, 2024
1 parent 44e2601 commit 4e998e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spork/math.janet
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,10 @@
(+= sy y)
(+= sxx (* x x))
(+= sxy (* x y)))
{:m (def m
(/ (- (* cl sxy) (* sx sy))
(- (* cl sxx) (* sx sx))))
(def m
(/ (- (* cl sxy) (* sx sy))
(- (* cl sxx) (* sx sx))))
{:m m
:b (- (/ sy cl) (/ (* m sx) cl))})))

(defn linear-regression-line
Expand Down

0 comments on commit 4e998e5

Please sign in to comment.