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

Method Rcl

extern/ttmath/ttmathuint.h:419–455  ·  view source on GitHub ↗

! moving all bits into the left side 'bits' times return value <- this <- C bits is from a range of <0, man * TTMATH_BITS_PER_UINT> or it can be even bigger then all bits will be set to 'c' the value c will be set into the lowest bits and the method returns state of the last moved bit */

Source from the content-addressed store, hash-verified

417 and the method returns state of the last moved bit
418 */
419 uint Rcl(uint bits, uint c=0)
420 {
421 uint last_c = 0;
422 uint rest_bits = bits;
423
424 if( bits == 0 )
425 return 0;
426
427 if( bits >= TTMATH_BITS_PER_UINT )
428 RclMoveAllWords(rest_bits, last_c, bits, c);
429
430 if( rest_bits == 0 )
431 {
432 TTMATH_LOG("UInt::Rcl")
433 return last_c;
434 }
435
436 // rest_bits is from 1 to TTMATH_BITS_PER_UINT-1 now
437 if( rest_bits == 1 )
438 {
439 last_c = Rcl2_one(c);
440 }
441 else if( rest_bits == 2 )
442 {
443 // performance tests showed that for rest_bits==2 it's better to use Rcl2_one twice instead of Rcl2(2,c)
444 Rcl2_one(c);
445 last_c = Rcl2_one(c);
446 }
447 else
448 {
449 last_c = Rcl2(rest_bits, c);
450 }
451
452 TTMATH_LOGC("UInt::Rcl", last_c)
453
454 return last_c;
455 }
456
457private:
458

Callers 4

Mul1RefMethod · 0.80
Div2_CalculateMethod · 0.80
Div3_NormalizeMethod · 0.80
operator<<Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected