> This is of course hilariously cursed. It will look almost perfect, but very rarely give numbers outside the expected range. If the D65538 is fair, it is usable: you just discard the two unwanted values when they show up and roll again. Those faces could be labelled as "roll again". If you have a uniform source of random numbers from 1 to N, you can get a uniform distribution from 1 to M < N simply by discarding val…
This process has an infinitely small (but non-zero) chance of never terminating.
If you're working with real numbers, then your step counter is a natural number, you repeat for[2] infinitely many steps, and the probability of failure is exactly zero.
If, on the hand, you're working with surreal numbers - which you would have to be for "infinitely small (but non-zero)" to make sense - then your step counter is a ordinal number[1], not a natural, and you repeat for[2] non-well-foundedly many steps (one for each ordinal), after which the probability of failure is again exactly zero. (Otherwise it would be the reciprocal of some surreal number, that is less than some ordinal, and for any ordinal, you can show that you tried a well-founded number of times that is nonetheless strictly greater than it.[0])
The more existent problem is that you can't put any useful upper bound on how many rerolls you'll need, which is terrible for constant-time algorithms, and particularly for cryptography.
0: And you actually only need two to the power of the number of tries to be greater, since the failure probability of one sample is at most 1/2, so the probability after K tries is at most 1/2^K.
1: ie, a positive whole surreal number, rather than a positive whole real number
2: Technically, you repeat for up to but not including that many, since you're guaranteed to terminate by then.