Lines Matching defs:rotate
2459 /* decNumberRotate -- rotate the coefficient of a Number left/right */
2466 /* rhs is B, the number of digits to rotate (-ve to right) */
2473 /* before the rotate. Any leading zeros in the result are removed */
2486 Int rotate; /* rhs as an Int */
2499 rotate=decGetInt(rhs); /* [cannot fail] */
2500 if (rotate==BADINT /* something bad .. */
2501 || rotate==BIGODD || rotate==BIGEVEN /* .. very big .. */
2502 || abs(rotate)>set->digits) /* .. or out of range */
2506 /* convert -ve rotate to equivalent positive rotation */
2507 if (rotate<0) rotate=set->digits+rotate;
2508 if (rotate!=0 && rotate!=set->digits /* zero or full rotation */
2510 /* left-rotate to do; 0 < rotate < set->digits */
2524 /* [if there are no whole units left to rotate, the */
2532 /* 3. rotate all the units by reversing left part, right */
2535 /* example: rotate right 8 digits (2 units + 2), DECDPUN=3. */
2549 /* Step 1: amount to shift is the partial right-rotate count */
2550 rotate=set->digits-rotate; /* make it right-rotate */
2551 units=rotate/DECDPUN; /* whole units to rotate */
2552 shift=rotate%DECDPUN; /* left-over digits count */
2567 /* If whole units to rotate... */
2569 /* Step 2: the units to touch are the whole ones in rotate, */
2579 /* Step 3: rotate the units array using triple reverse */
2584 } /* whole units to rotate */
2588 } /* rotate needed */