I am trying to generate an arithmetic and geometric series/sequence with JavaScript.
i trying generate arithmetic , geometric
series/sequence javascript. thing makes challenging that
i using user input determine different parts of formula using to
generate each sequence. have tried run formulas, found out was
running strings through them , not numbers. how generate my
sequences/series , still use user input? ps, these formulas: (a1 is
first term, d , r difference/ratio, , n nth term)
1.) a1 + d * n
2.)a1 * r^n
user input form string. there several ways convert string number in javascript:
- pass argument number()
- pass argument parseint() (for integer)
- pass argument parsefloat() (for floating-point number)
More discussions in Coding Corner
adobe
Comments
Post a Comment