C++ Programming/Code/Standard C Library/Functions/sin


#include <cmath>
double sin( double arg );

If you don't want cmath you can write sin function it is;

  1. include <iostream>

using namespace std;

double sin(double x) //sin function {return x-((x*x*x)/6.)+((x*x*x*x*x)/120.);}

int main () {

   double a;

return 0;}

The function sin() returns the sine of arg, where arg is given in radians. The return value of sin() will be in the range [-1,1]. If arg is infinite, sin() will return NAN and raise a floating-point exception.

Related topics
acos - asin - atan - atan2 - cos - cosh - sinh - tan - tanh
Last modified on 24 November 2012, at 17:24