jagomaniak wrote: > Hello, > I'm writing a program computing the tg function with sin/cos. However, > I'm not allowed to use the math.h fuction for either of it, so I'm > quite stuck as how to implement it. > > Any help is appreciated!
A Taylor Series is definitely the way to go if you are rolling your own. However, you won't get too many decimal places of accuracy (factorial and floating-point limitations) and it won't perform nearly as well as the math library (which typically uses several shortcut tricks and lookup tables to pull off high-performance lookups), but it will work. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
