I'm doing a little programming which requires the use of some random numbers. Basically I add a random value at one stage, and subtract it a bit later. Something like this pseudo-code (where "x" is an existing variable):
set rand_value <- (random) set new_value <- x + rand_value ... do stuff ... set new_value <- new_value - rand_value All values may be considered Reals. I tried to do this in Typed Racket, where x was of type "Real" and got errors about mismatched types: "(random)" produces a "flonum". I was also using "set!" for the assignment of the random value, which I understand to be poor practice: how would I do something like the above in a more "rackety" manner? Thank you! -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.