{"comment":{"url":"https://api.github.com/repos/latex3/latex3/comments/28812097","html_url":"https://github.com/latex3/latex3/commit/c83d05b3f8ad6778d756b1e08d095e16a3b7e23c#commitcomment-28812097","id":28812097,"user":{"login":"jfbu","id":2589111,"avatar_url":"https://avatars0.githubusercontent.com/u/2589111?v=4","gravatar_id":"","url":"https://api.github.com/users/jfbu","html_url":"https://github.com/jfbu","followers_url":"https://api.github.com/users/jfbu/followers","following_url":"https://api.github.com/users/jfbu/following{/other_user}","gists_url":"https://api.github.com/users/jfbu/gists{/gist_id}","starred_url":"https://api.github.com/users/jfbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfbu/subscriptions","organizations_url":"https://api.github.com/users/jfbu/orgs","repos_url":"https://api.github.com/users/jfbu/repos","events_url":"https://api.github.com/users/jfbu/events{/privacy}","received_events_url":"https://api.github.com/users/jfbu/received_events","type":"User","site_admin":false},"position":33,"line":357,"path":"l3kernel/l3fp-random.dtx","commit_id":"c83d05b3f8ad6778d756b1e08d095e16a3b7e23c","created_at":"2018-05-01T20:49:25Z","updated_at":"2018-05-01T20:49:25Z","author_association":"NONE","body":"Here is a quote from Knuth TACP, vol II, chap. on random numbers, summary vii):\r\n\r\n(he seems to comment a ``X<- aX+c mod N`` rule, with N power of 2 and a equal to 5 mod 8 so that it generates maximal size subgroup of multiplicative group)\r\n\r\n```\r\nThe least significant (right-hand) digits of X are not very random, so de-\r\ndecisions based on the number X should always be influenced primarily by\r\nthe most significant digits. It is generally best to think of X as a random\r\nfraction X/m between 0 and 1, that is, to visualize X with a radix point at\r\nits left, rather than to regard X as a random integer between 0 and m — 1.\r\nTo compute a random integer between 0 and k—1, one should multiply by k\r\nand truncate the result. (Don't divide by k; see exercise 3.4.1-3.)\r\n```\r\nThus of course he is well aware of low bits badness (i haven't check the exercise). I have not checked pdftex, but I expect it to follow the advice so to do ``trunc(k*random(2**28)/2**28)`` to get random integer from 0 to k-1. This is not quite uniform though as you comment in the expl3 code."}}
{"actor":{"display_login":"jfbu"}}