Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #17709

Re: Primality by Wilson Theorem

From Ike Naar <ike@iceland.freeshell.org>
Newsgroups comp.lang.c
Subject Re: Primality by Wilson Theorem
Date 2012-02-20 22:52 +0000
Organization A noiseless patient Spider
Message-ID <slrn3vfsjk5jm3.1fd.ike@iceland.freeshell.org> (permalink)
References <21835173.5344.1329724442804.JavaMail.geo-discussion-forums@vbtb2> <d215k7lhp2giliim2vrrpfbo6ooj7cjm8h@4ax.com>

Show all headers | View raw


On 2012-02-20, Barry Schwarz <schwarzb@dqel.com> wrote:
> On Sun, 19 Feb 2012 23:54:02 -0800 (PST), janus <emekamicro@gmail.com>
> wrote:
>
>># include <stdio.h>
>>
>>
>>long long int  factorial( long long int num){
>>	long long int tempNum ;
>>	long long int acc = 1;
>>	for(tempNum = 1; tempNum < num + 1; ++tempNum){
>>		acc = acc * tempNum;
>
> The first iteration contributes nothing to the result.  You could
> start with tempNum set to 2

But then factorial(1) would no longer work.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Primality by Wilson Theorem janus <emekamicro@gmail.com> - 2012-02-19 23:54 -0800
  Re: Primality by Wilson Theorem Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 00:39 -0800
    Re: Primality by Wilson Theorem Noob <root@127.0.0.1> - 2012-02-20 11:50 +0100
  Re: Primality by Wilson Theorem "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-02-20 01:15 -0800
  Re: Primality by Wilson Theorem pacman@kosh.dhis.org (Alan Curry) - 2012-02-20 09:31 +0000
    Re: Primality by Wilson Theorem gwowen <gwowen@gmail.com> - 2012-02-20 03:44 -0800
  Re: Primality by Wilson Theorem Barry Schwarz <schwarzb@dqel.com> - 2012-02-20 10:33 -0800
    Re: Primality by Wilson Theorem janus <emekamicro@gmail.com> - 2012-02-20 11:12 -0800
      Re: Primality by Wilson Theorem Paul <nospam@needed.com> - 2012-02-20 16:21 -0500
        Re: Primality by Wilson Theorem janus <emekamicro@gmail.com> - 2012-02-21 03:08 -0800
    Re: Primality by Wilson Theorem Ike Naar <ike@iceland.freeshell.org> - 2012-02-20 22:52 +0000
      Re: Primality by Wilson Theorem Ike Naar <ike@iceland.freeshell.org> - 2012-02-20 22:55 +0000
  Re: Primality by Wilson Theorem Robert Miles <milesrf@Usenet-News.net> - 2012-03-31 00:38 -0500
    Re: Primality by Wilson Theorem 88888 Dihedral <dihedral88888@googlemail.com> - 2012-04-03 12:06 -0700

csiph-web