If you want to do it yourself instead of using a math library, then my immediate thought is tp write out and calculate the Taylor series of your function. sin(x) is basically x +x^3 + x^5 +... with appropriate constants (look them up on wikipedia) so then sin(x)/x is the same thing but you divide all the parts by x so you're gonna have c + x^2 + x^4 + ... Now just add more parts in a while loop until the error term is small enough or you have spent some maximal number of allowed iterations and you're good.
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
replies: