• λ我爱Aspx >> Asp.Net >> A Good 31 bit Random Number Generator Class
  • A Good 31 bit Random Number Generator Class

  • :aspxer  Դ:internet  :2007-5-31 2:20:30  ؼ:
  • /// T(z) = (z/q) - (az/m)

    ///

    /// F(z) = a(z%q)- rz/q+ m((z/q) - a(z/m))

    /// = a(z%q)- rz/q+ m(z/q) - az

    ///

    /// NOTE JAE: I could easily extend this class to a C# 63 bit LCG but,

    /// don@#t really see the point for most applications I have.

    /// Besides 2**63 -1 is 9,223,372,036,854,775,807 that@#s 19

    /// digits of precision. A double only has 15- 16 digits

    /// of precision. Since my typical use is a double that@#s

    /// at least 3 digits of precision I could never use. (of

    /// course 2**31 -1 is only 10 digits of precision so that@#s

    /// five less than I could use ...)

    ///

    /// Advantages of a 64 bit generator would be the insanely

    /// long cycle until it repeats. Disadvantages would be

    /// the implementation complexities of picking correct/good

    /// m and q values, then testing it. I@#ll probabaly create

    Ҷƪл˵?
  • һƪ一棵C#写的树(1) he_x(原作)
    һƪ浅谈图像压缩算法(好文章。看看吧。再别说不了解JPG的原理了)