Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion RNGs: A Super KISS
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tom St Denis  
View profile  
 More options Nov 3 2009, 8:32 pm
Newsgroups: sci.math, comp.lang.c, sci.crypt
From: Tom St Denis <t...@iahu.ca>
Date: Tue, 3 Nov 2009 12:32:54 -0800 (PST)
Local: Tues, Nov 3 2009 8:32 pm
Subject: Re: RNGs: A Super KISS
On Nov 3, 10:46 am, geo <gmarsag...@gmail.com> wrote:

>   int refill( )
>   { int i; unsigned long long t;
>   for(i=0;i<41790;i++) { t=7010176LL*Q[i]+carry; carry=(t>>32); Q[i]=~
> (t);}
>   indx=1; return (Q[0]);
>   }

Not to nitpick but your C code could use some work.  First off, some
indentation please?  Second, returning a unsigned long long as "int"
is not very portable.

Part of the good thing of PRNGs is that they're reproduceable.
Ideally over different platforms.  You should truncate the return
value if you want it as "int" or change the return type.  As it stands
now this will produce different results on my x86-32 and 64 boxes for
the same seed, which is a bad thing.

Tom


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google