What's wrong with

1
2
3
4
[<ThreadStatic>]
let mutable rseed = null : System.Random 
let rnd() = if rseed = null then rseed <- new System.Random()
            rseed.NextDouble()

? You may multiply-initialize it, but no big deal, and then the overhead per call is just an 'if' (very cheap).

By on 1/14/2009 5:17 PM ()

You're right. That's not so bad. I was over thinking the problem.

Thanks.

By on 1/16/2009 11:21 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper