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

Method Pow

extern/ttmath/ttmathint.h:607–630  ·  view source on GitHub ↗

! power this = this ^ pow return values: 0 - ok 1 - carry 2 - incorrect arguments 0^0 or 0^(-something) */

Source from the content-addressed store, hash-verified

605 2 - incorrect arguments 0^0 or 0^(-something)
606 */
607 uint Pow(Int<value_size> pow)
608 {
609 if( !pow.IsSign() )
610 return Pow2(pow);
611
612 if( UInt<value_size>::IsZero() )
613 // if 'pow' is negative then
614 // 'this' must be different from zero
615 return 2;
616
617 if( pow.ChangeSign() )
618 return 1;
619
620 Int<value_size> t(*this);
621 uint c_temp = t.Pow2(pow);
622 if( c_temp > 0 )
623 return c_temp;
624
625 UInt<value_size>::SetOne();
626 if( Div(t) )
627 return 1;
628
629 return 0;
630 }
631
632
633

Callers 5

ASin_1Function · 0.45
SetBernoulliNumbersSumFunction · 0.45
SetBernoulliNumbersMoreFunction · 0.45
GammaFactorialHighSumFunction · 0.45
GammaFactorialHighFunction · 0.45

Calls 3

IsSignMethod · 0.80
ChangeSignMethod · 0.80
Pow2Method · 0.80

Tested by

no test coverage detected