nyef wrote:
This... is actually kindof neat. And it's simple fixed-point math.
The word RANDOM returns a "random" cell-sized value (it's not particularly random, and the seed is atrocious). Think of this as being a value between 0 and just below 1. UM* multiplies that value by an exclusive upper bound, returning a 2-cell fixed-point result, the integer part being the high bits of the result and the fractional part being the low bits. It then discards the fractional part.
Thanks! I also asked on the Forth Facebook group and it sort of dovetailed with a discussion a few days ago about the use of um* vs. mod. It turns out to be better to use um*.
The seed might not be excellent but it works on every system, which is why I'm guessing why it was used. It is not the most random of random generators but it is short, simple and fairly good.
I'm still at the point of 'translating' Forth to a more familiar language in my head, sort of like you would do when learning a new spoken language. I think this hinders understanding how tings work at times.