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

Method MulInt

extern/ttmath/ttmathint.h:397–428  ·  view source on GitHub ↗

! multiplication: this = this * ss2 it can return a carry */

Source from the content-addressed store, hash-verified

395 it can return a carry
396 */
397 uint MulInt(sint ss2)
398 {
399 bool ss1_is_sign, ss2_is_sign;
400 uint c;
401
402 ss1_is_sign = IsSign();
403
404 /*
405 we don't have to check the carry from Abs (values will be correct
406 because next we're using the method MulInt from the base class UInt
407 which is without a sign)
408 */
409 Abs();
410
411 if( ss2 < 0 )
412 {
413 ss2 = -ss2;
414 ss2_is_sign = true;
415 }
416 else
417 {
418 ss2_is_sign = false;
419 }
420
421 c = UInt<value_size>::MulInt((uint)ss2);
422 c += CheckMinCarry(ss1_is_sign, ss2_is_sign);
423
424 if( ss1_is_sign != ss2_is_sign )
425 SetSign();
426
427 return c;
428 }
429
430
431

Callers 6

SetFactorialSequenceFunction · 0.45
GammaPlusLowIntegerIntFunction · 0.45
setMethod · 0.45
setScaleMethod · 0.45
operator*=Method · 0.45
I128limitMethod · 0.45

Calls 1

AbsFunction · 0.85

Tested by

no test coverage detected