Frobenius Probable Prime Test

Karl Hasselstrom
Fri, 30 May 2003 16:24:47 +0200

On 2003-05-29 22:06:06 -0400, Rick Lavoie wrote:
[without saying who he quoted]

> > "Rick Lavoie" <> writes:
> >
> > > for (i = m_bitsize-1; i >= 0; i--) { /* We loop over the bits of m, analogous to powering */
> >
> > If you want to work something up as a demo for inclusion the gmp
> > distribution you'll need it in GNU coding style.
> I looked at the standards, but I couldn't find anything applicable
> to the above for loop.

They want the { on a separate line, like this:

for (i = 0; i < foo; i++)
    printf ("i is less than %d\n", foo);

Note that the {}s are indented only two spaces, while the body of the
loop is indented four spaces. The default emacs C mode will take care
of that detail for you, though; all you have to remember is to put the
{}s on separate lines.

The relevant part of the GNU Coding Standards is section 5, and
particularly section 5.1.

Karl Hasselström,