I was trying to play with making a random number stream
and the numbers that work in C result in a very short period
when PostScript's auto-promoting mul is used.
Is there a way to do an integer multiply that truncates the
result to an integer ... in PS? Or some other way to generate
random numbers with the operators available in PostScript?
quit
On Wednesday, November 30, 2022 at 8:09:11 PM UTC-6, luser droog wrote:
I was trying to play with making a random number stream
and the numbers that work in C result in a very short period
when PostScript's auto-promoting mul is used.
Is there a way to do an integer multiply that truncates the
result to an integer ... in PS? Or some other way to generate
random numbers with the operators available in PostScript?
Oops. Duh. If I mod them off to 16bits first then the mul shouldn't overflow.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 489 |
Nodes: | 16 (2 / 14) |
Uptime: | 37:49:43 |
Calls: | 9,669 |
Files: | 13,716 |
Messages: | 6,169,514 |