MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / Cos

Function Cos

extern/ttmath/ttmath.h:575–599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573 */
574 template<class ValueType>
575 ValueType Cos(ValueType x, ErrorCode * err = 0)
576 {
577 if( x.IsNan() )
578 {
579 if( err )
580 *err = err_improper_argument;
581
582 return x; // NaN
583 }
584
585 ValueType pi05;
586 pi05.Set05Pi();
587
588 uint c = x.Add( pi05 );
589
590 if( c )
591 {
592 if( err )
593 *err = err_overflow;
594
595 return ValueType(); // result is undefined (NaN is set by default)
596 }
597
598 return Sin(x, err);
599 }
600
601
602 /*!

Callers 2

TanFunction · 0.85
CotFunction · 0.85

Calls 3

ValueTypeEnum · 0.85
SinFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected