- public static double tan( double x )
- {
- long T[] = { 0 , 1 , 0 , -2 , 0 , 16 , 0 , -272 , 0 , 7936 , 0 , -353792 , 0 , 22368256 , 0 , -1903757312 } ;
- double sum = 0 ;
- for( int i = 0 ; i < 8 ; i ++ )
- sum += ( T[2*i+1] * pow( -1 , i ) * pow( x , 2 * i + 1 ) ) / ( fact( 2 * i + 1 ) ) ;
- return sum ;
- }
复制代码
Java代码一段,求点评 |
|