🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.programming
Article #217305

Co robi permuted congruential generator XSL-RR-RR? Próbuję zrozumieć scheamt działania.

#217305
From: osobli...
Date: Sat, 02 Jan 2021 13:28
14 lines
2105 bytes
Znalazłem ostatnio generator liczb pseudolosowych, który mnie interesuje:

https://en.wikipedia.org/wiki/Permuted_congruential_generator

Ale nie jestem w stanie zrozumieć kodu, który jest tam podany. To jest zdaje się w języku C:

1. count = (int)(x >> 122)
2. low64 = rotr64((uint64_t)(x ^ (x >> 64)), count)
3. high64 = rotr((uint64_t)(x >> 64), low64 & 63)
4. return (uint128_t)high64 << 64 | low64

Jedyne co rozumiem to ">>", "^" i "&". Ale czym jest "int"? Czy to (int)(x >> 122) mam rozumieć jako mnożenie dwóch liczb w nawiasach? Co robi rotr64 i czym się różni od rotr? Co to jest uint64_t? Co to jest "|" i jako rozumieć (uint128_t)high64 << 64 | low64?

Czy ktoś coś z tego rozumie? Nie znam C i nie jestem pewien, czy to jest kod w C, czy coś jeszcze innego.
Technical Details
Message-ID: <2149118b-1cf9-4f45-b6a3-7b59a60446c4n@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Received: by 2002:a37:6189:: with SMTP id v131mr62706024qkb.337.1609594098094;        Sat, 02 Jan 2021 05:28:18 -0800 (PST)
X-Received: by 2002:ac8:7313:: with SMTP id x19mr62722758qto.243.1609594097856; Sat, 02 Jan 2021 05:28:17 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: pl.comp.programming
Date: Sat, 2 Jan 2021 05:28:17 -0800 (PST)
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a458:2a00:1:7cc7:2090:a191:1806; posting-account=5sNFBgoAAAAxlae8lv99mPyGsDs6ynwB
NNTP-Posting-Host: 2a02:a458:2a00:1:7cc7:2090:a191:1806
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2149118b-1cf9-4f45-b6a3-7b59a60446c4n@googlegroups.com>
Subject: Co robi permuted congruential generator XSL-RR-RR?
 Próbuję zrozumieć scheamt
 działania.
From: "osobli...@gmail.com" <osobliwy.nick@gmail.com>
Injection-Date: Sat, 02 Jan 2021 13:28:18 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit