jiggzson / nerdamer

a symbolic math expression evaluator for javascript
http://www.nerdamer.com
MIT License
517 stars 82 forks source link

Continued fractions #340

Closed Happypig375 closed 5 years ago

Happypig375 commented 6 years ago

This function takes a number and returns a vector representing the continued fraction.

Definition: continued(number, maxlength) Example: continued(6/7,7) => [0, 1, 6] Visual representation: 6/7 = 0+1/(1+1/6)

2nd example: continued(pi, 5) => [3,7,15,1,292] Visual representation: pi = 3+1/(7+1/(15+1/(1+1/(292+1/(…)))))

jiggzson commented 5 years ago

@Happypig375, haven't you already implemented something very similar to this? Or at least started?

Happypig375 commented 5 years ago

Nope. Do you mean #402?

jiggzson commented 5 years ago

I guess that's what I was referring to. Am I getting the two confused. Can the same logic be reused?

Happypig375 commented 5 years ago

If we are going to reuse them, then I'm unsure what to reuse.