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

Function RootCheckIndexZero

extern/ttmath/ttmath.h:1889–1914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1887
1888 template<class ValueType>
1889 bool RootCheckIndexZero(ValueType & x, const ValueType & index, ErrorCode * err)
1890 {
1891 if( index.IsZero() )
1892 {
1893 if( x.IsZero() )
1894 {
1895 // there isn't root(0;0) - we assume it's not defined
1896 if( err )
1897 *err = err_improper_argument;
1898
1899 x.SetNan();
1900
1901 return true;
1902 }
1903
1904 // root(x;0) is 1 (if x!=0)
1905 x.SetOne();
1906
1907 if( err )
1908 *err = err_ok;
1909
1910 return true;
1911 }
1912
1913 return false;
1914 }
1915
1916
1917 template<class ValueType>

Callers 1

RootFunction · 0.85

Calls 2

IsZeroMethod · 0.80
SetOneMethod · 0.80

Tested by

no test coverage detected