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

Method Sub

extern/ttmath/ttmathint.h:298–306  ·  view source on GitHub ↗

! this method subtracts two values with a sign we don't use the previous Add because the method ChangeSign can sometimes return carry this = p1(=this) - p2 when p1>=0 i p2>=0 carry will never be set when p1<0 i p2<0 carry will never be set when p1>=0 i p2<0 carry is set when the highest bit of value is set when p1<0 i p2>=0 carry is set when the highest bit of value is cle

Source from the content-addressed store, hash-verified

296 when p1<0 i p2>=0 carry is set when the highest bit of value is clear
297 */
298 uint Sub(const Int<value_size> & ss2)
299 {
300 bool p1_is_sign = IsSign();
301 bool p2_is_sign = ss2.IsSign();
302
303 UInt<value_size>::Sub(ss2);
304
305 return CorrectCarryAfterSubtracting(p1_is_sign, p2_is_sign);
306 }
307
308
309 /*!

Callers 15

FloorFunction · 0.45
PrepareSinFunction · 0.45
Sin0pi05Function · 0.45
ASin_1Function · 0.45
ACosFunction · 0.45
ATan0Function · 0.45
ATan01Function · 0.45
ATanGreaterThanPlusOneFunction · 0.45
ACotFunction · 0.45
SinhFunction · 0.45
TanhFunction · 0.45
CothFunction · 0.45

Calls 1

IsSignMethod · 0.80

Tested by

no test coverage detected