From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 109d8a,ea40acba15d5d078 X-Google-NewGroupId: yes X-Google-Thread: 1014db,ea40acba15d5d078 X-Google-NewGroupId: yes X-Google-Thread: 1094ba,ea40acba15d5d078 X-Google-NewGroupId: yes X-Google-Thread: 101deb,620e03552eca5f22 X-Google-NewGroupId: yes X-Google-Thread: 103376,c5d0be666830517 X-Google-NewGroupId: yes X-Google-Attributes: gid9ef9b79ae9,gid4516fb5702,gid8d3408f8c3,gidbda4de328f,gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!goblin2!goblin3!goblin.stu.neva.ru!exi-transit.telstra.net!news.telstra.net!exi-spool.telstra.net!exi-reader.telstra.net!not-for-mail From: "robin" Newsgroups: sci.math,comp.lang.c,comp.lang.fortran,comp.lang.pl1,comp.lang.ada References: Subject: Re: KISS4691, a potentially top-ranked RNG. Date: Tue, 27 Jul 2010 20:19:50 +1000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Message-ID: <4c4ecbef$0$12393$c30e37c6@exi-reader.telstra.net> NNTP-Posting-Host: 123.3.18.101 X-Trace: 1280232431 exi-reader.telstra.net 12393 123.3.18.101:1042 Xref: g2news1.google.com sci.math:175082 comp.lang.c:98800 comp.lang.fortran:26039 comp.lang.pl1:1580 comp.lang.ada:12604 Date: 2010-07-27T20:19:50+10:00 List-Id: "jacob navia" wrote in message news:i2fir2$op4$1@speranza.aioe.org... | This doesn't work with systems that have unsigned long as a 64 bit quantity. | | I obtain: | | MWC result=3740121002 ? | 4169348530 | KISS result=2224631993 ? | 1421918629 For a 64-bit machine (using 64-bit integer arithmetic), you'd need to truncate each result to 32 bits. That not only applies to the multiplication, it also applies to addition, etc. On a 32-bit machine, these extra bits are discarded, but in 64-bit arithmetic, they are retained, and unless they are similarly discarded, you won't get the same results. I suggest using IAND(k, 2*2147483647+1) for the truncation. With such modifications in the program, it should then produce the same results on both 32-bit and 64-bit machines. P.S. the product 2*2... is best obtained using ISHFT. | Compiling with 32 bit machine yields: | MWC result=3740121002 ? | 3740121002 | KISS result=2224631993 ? | 2224631993