* Custom integer square root from * https://en.wikipedia.org/wiki/Integer_square_root */
| 605 | * https://en.wikipedia.org/wiki/Integer_square_root |
| 606 | */ |
| 607 | static int sqrti(int val) |
| 608 | { |
| 609 | float d, x = val; |
| 610 | |
| 611 | if (!val) |
| 612 | return 0; |
| 613 | |
| 614 | do { |
| 615 | float y = (x + (float)val / x) / 2; |
| 616 | d = (y > x) ? y - x : x - y; |
| 617 | x = y; |
| 618 | } while (d >= 0.5); |
| 619 | |
| 620 | return (int)x; |
| 621 | } |
| 622 | |
| 623 | static struct commit_list *skip_away(struct commit_list *list, int count) |
| 624 | { |