Details and Options
- BlockRandom[expr] in effect saves the states of all pseudorandom generators before evaluating expr, then restores them afterwards.
- BlockRandom[expr] always gives the same result as just evaluating expr, though it can affect values obtained for subsequent expressions.
- BlockRandom[expr,RandomSeeding->seeding] specifies that the random generators should be seeded with the specified seeding before evaluating expr.
- BlockRandom has attribute HoldFirst.
- Many built-in functions in the Wolfram Language effectively use BlockRandom.
Examplesopen all close all
Introduced in 2007Updated in 2017