[Mono-osx] bug in Random

Geoff Norton gnorton at novell.com
Sun Jan 25 15:26:40 EST 2009


Duane,

  Is there some reason juts copying our Random class into your library
doesn't work for you?  Its MIT/X11 licensed so you have no concerns if
your project is commercial, and you'll get the same results on all CLRs
then.

-g

On Sun, 2009-01-25 at 15:17 -0500, Duane Wandless wrote:
>         Rodrigo is on the Mono team and has already answered you.
>  
> Not very obvious he (kumpera at gmail.com) is on the Mono team...
> actually it just seemed like the response was from a random mono
> user.  Ha!  Joke aside, that is what I thought.
> 
> 
> Anyway... for what it is worth, I disagree.  The advantage of having
> the same pseudo random numbers given the same seed is important.  Yes
> I can write my own algorithm to accomplish that but I prefer not to
> reinvent the wheel.  That was and most of the time is one of the
> biggest advantages of Mono.  I do not have to rewrite code... I can
> reuse from Windows to Mac to Linux and I can focus on the core
> functionality of my applications.  Not random differences between the
> OSes or random programming languages specific to that OS.
> 
> 
> My only request is that the decision not to provide the same
> functionality as the Microsoft's library in this case was indeed by
> design and not a random decision by some random developer.
> 
> 
> Okay -- enough random jokes... but the request is legit.
> 
> 
> Thanks for the responses.
> Duane
> 
> 
> On Sun, Jan 25, 2009 at 2:30 PM, Geoff Norton <gnorton at novell.com>
> wrote:
>         Rodrigo is on the Mono team and has already answered you.
>         
>         
>         On Sun, 2009-01-25 at 14:24 -0500, Duane Wandless wrote:
>         > Hello Mono-team... Can you please provide an answer?  Was
>         the
>         > intention to use a different algorithm for the Random class,
>         or was
>         > that a mistake?  Honestly I cannot see a technical reason to
>         use a
>         > different one.
>         >
>         >
>         > Thanks.
>         >
>         > On Mon, Jan 19, 2009 at 5:43 PM, Rodrigo Kumpera
>         <kumpera at gmail.com>
>         > wrote:
>         >         Your application depends on an implementation detail
>         of the MS
>         >         runtime.
>         >         There is no guarantee either that they won't change
>         the Random
>         >         algorithm.
>         >
>         >         This is unfortunate to your application but the
>         solution is
>         >         pretty simple, copy mono's
>         >         implementation to your project and rely on it
>         instead of an
>         >         external prng.
>         >
>         >
>         >
>         >
>         >         On Mon, Jan 19, 2009 at 8:38 PM, MacUser
>         >         <atlas at spiralgraphics.biz> wrote:
>         >
>         >                 This is also a point of concern for me.  My
>         code ,
>         >                 written on Microsoft .NET,
>         >                 relied on the fact that using the same seed
>         will
>         >                 always produce the same
>         >                 series of numbers.  To port to Mono, not
>         only would I
>         >                 need Mono's Random()
>         >                 to be consistant across all Mono platforms,
>         but also
>         >                 consistant to the
>         >                 results that Microsoft's Random() produces.
>         >
>         >                 By the way, I work in the algorithmic
>         graphics
>         >                 generation area, where an
>         >                 image produced with the same input values
>         must always
>         >                 look the same
>         >                 regardless of the platform the app is
>         running on.
>         >                  This is why reliable
>         >                 seeding is so important.
>         >
>         >
>         >
>         >
>         >                 Rodrigo Kumpera wrote:
>         >                 >
>         >                 > It doesn't state the the algorithm has to
>         be the
>         >                 same, just that it must
>         >                 > be
>         >                 > reproducible given the same seed.
>         >                 >
>         >                 > On Mon, Jan 19, 2009 at 3:27 PM, Duane
>         Wandless
>         >                 <duane at wandless.net>
>         >                 > wrote:
>         >                 >
>         >                 >> That is a valid question.  From MSDN, the
>         Random
>         >                 class is a Pseudo-random
>         >                 >> number generator:
>         >                 >> The random number generation starts from
>         a seed
>         >                 value. If the same seed
>         >                 >> is
>         >                 >> used repeatedly, the same series of
>         numbers is
>         >                 generated.
>         >                 >>
>         >                 >>
>         >
>         http://msdn.microsoft.com/en-us/library/system.random.aspx
>         >                 >>
>         >                 >> The value in this is that given a seed
>         will produce
>         >                 the same sequence of
>         >                 >> random numbers.  So if the client and
>         server both
>         >                 know the seed then
>         >                 >> the algorithm will work correctly on both
>         >                 platforms.
>         >                 >>
>         >                 >>
>         >                 >> On Mon, Jan 19, 2009 at 12:09 PM, Matt
>         Emson
>         >                 >> <memsom at interalpha.co.uk>wrote:
>         >                 >>
>         >                 >>> Duane Wandless wrote:
>         >                 >>>
>         >                 >>>> Maybe I incorrectly assume that the
>         pseudo-random
>         >                 number should be the
>         >                 >>>> same on both platforms... but I believe
>         that it
>         >                 should be a predictable
>         >                 >>>> sequence given the same seed.
>         >                 >>>>
>         >                 >>> Maybe this is a silly question, but why
>         would you
>         >                 want your *random*
>         >                 >>> number to be the same on both platforms,
>         more so
>         >                 "a predictable
>         >                 >>> sequence"?
>         >                 >>> Sure I'm missing something obvious,
>         but... ?!
>         >                 >>>
>         >                 >>
>         >                 >>
>         >                 >>
>         _______________________________________________
>         >                 >> Mono-osx mailing list
>         >                 >> Mono-osx at lists.ximian.com
>         >                 >>
>         http://lists.ximian.com/mailman/listinfo/mono-osx
>         >                 >>
>         >                 >>
>         >                 >
>         >                 >
>         _______________________________________________
>         >                 > Mono-osx mailing list
>         >                 > Mono-osx at lists.ximian.com
>         >                 >
>         http://lists.ximian.com/mailman/listinfo/mono-osx
>         >                 >
>         >                 >
>         >
>         >
>         >                 --
>         >                 View this message in context:
>         >
>         http://www.nabble.com/bug-in-Random-tp21544091p21553211.html
>         >                 Sent from the Mono - OSX mailing list
>         archive at
>         >                 Nabble.com.
>         >
>         >
>         >
>         _______________________________________________
>         >                 Mono-osx mailing list
>         >                 Mono-osx at lists.ximian.com
>         >
>         http://lists.ximian.com/mailman/listinfo/mono-osx
>         >
>         >
>         >
>         >
>         >         _______________________________________________
>         >         Mono-osx mailing list
>         >         Mono-osx at lists.ximian.com
>         >         http://lists.ximian.com/mailman/listinfo/mono-osx
>         >
>         >
>         >
>         > _______________________________________________
>         > Mono-osx mailing list
>         > Mono-osx at lists.ximian.com
>         > http://lists.ximian.com/mailman/listinfo/mono-osx
>         
>         
> 
> 



More information about the Mono-osx mailing list