12 Mar
2009
12 Mar
'09
8:10 a.m.
You need to use the std:: versions of the math functions when writing C ++ code. That is use "std::abs", "std::sin" etc.
By using the C++ versions, rather than the C version, you make sure that the correctly overloaded version is used. If you, for example, use just "abs", then the argument is implicitly converted to an int, which is probably not what you want. Likewise, using "sinf" in algebra where we are using doubles for computation truncates the argument, loosing accuracy for no reason.