www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Random.next is deprecated

reply Sam Hu <samhu.samhu gmail.com> writes:
Hi,

In Tango I want to use Random.next(uint i) to generate a random number
between(0,i) but the compiler told me the next(...) function is deprecated.So
what is the equivalent function?
Thanks,
Sam
Sep 11 2008
next sibling parent reply "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Thu, Sep 11, 2008 at 9:53 PM, Sam Hu <samhu.samhu gmail.com> wrote:
 Hi,

 In Tango I want to use Random.next(uint i) to generate a random number
between(0,i) but the compiler told me the next(...) function is deprecated.So
what is the equivalent function?
 Thanks,
 Sam

import tango.math.random.Kiss; Kiss.shared.toInt(i) Dumb name, but it's pretty much the same thing :)
Sep 11 2008
parent Sam Hu <samhu.samhu gmail.com> writes:
Thanks Jarrett.

It works now.But I am wondering why does such changes,any special reason?

Thanks again.
Sep 11 2008
prev sibling next sibling parent "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Thu, Sep 11, 2008 at 10:35 PM, Sam Hu <samhu.samhu gmail.com> wrote:
 Thanks Jarrett.

 It works now.But I am wondering why does such changes,any special reason?

 Thanks again.

Dunno. Maybe they're planning on having other kinds of RNGs in tango.math.random.
Sep 11 2008
prev sibling next sibling parent "Bill Baxter" <wbaxter gmail.com> writes:
On Fri, Sep 12, 2008 at 11:45 AM, Jarrett Billingsley
<jarrett.billingsley gmail.com> wrote:
 On Thu, Sep 11, 2008 at 10:35 PM, Sam Hu <samhu.samhu gmail.com> wrote:
 Thanks Jarrett.

 It works now.But I am wondering why does such changes,any special reason?

 Thanks again.

Dunno. Maybe they're planning on having other kinds of RNGs in tango.math.random.

I was wondering about that Kiss module too. I really hope it's not Kiss as in "keep it simple stupid". If so I think I'm going to barf. Please tell me there's some RNG algorithm known as Kiss. Googling didn't turn it up, but maybe my google-fu is just weak. --bb
Sep 11 2008
prev sibling next sibling parent Moritz Warning <moritzwarning web.de> writes:
On Fri, 12 Sep 2008 11:50:00 +0900, Bill Baxter wrote:

 On Fri, Sep 12, 2008 at 11:45 AM, Jarrett Billingsley
 <jarrett.billingsley gmail.com> wrote:
 On Thu, Sep 11, 2008 at 10:35 PM, Sam Hu <samhu.samhu gmail.com> wrote:
 Thanks Jarrett.

 It works now.But I am wondering why does such changes,any special
 reason?

 Thanks again.

tango.math.random.

as in "keep it simple stupid". If so I think I'm going to barf. Please tell me there's some RNG algorithm known as Kiss. Googling didn't turn it up, but maybe my google-fu is just weak. --bb

It's the name of a RNG by Marsaglia. 287 + a simple RNG
Sep 11 2008
prev sibling next sibling parent "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Thu, Sep 11, 2008 at 10:50 PM, Bill Baxter <wbaxter gmail.com> wrote:
 On Fri, Sep 12, 2008 at 11:45 AM, Jarrett Billingsley
 <jarrett.billingsley gmail.com> wrote:
 On Thu, Sep 11, 2008 at 10:35 PM, Sam Hu <samhu.samhu gmail.com> wrote:
 Thanks Jarrett.

 It works now.But I am wondering why does such changes,any special reason?

 Thanks again.

Dunno. Maybe they're planning on having other kinds of RNGs in tango.math.random.

I was wondering about that Kiss module too. I really hope it's not Kiss as in "keep it simple stupid". If so I think I'm going to barf. Please tell me there's some RNG algorithm known as Kiss. Googling didn't turn it up, but maybe my google-fu is just weak. --bb

Get your vomit bag ready. Yes, Marsaglia came up with it and named it, and yes, he named it after "Keep it simple stupid". :P
Sep 11 2008
prev sibling next sibling parent "Bill Baxter" <wbaxter gmail.com> writes:
On Fri, Sep 12, 2008 at 12:40 PM, Moritz Warning <moritzwarning web.de> wrote:
 On Fri, 12 Sep 2008 11:50:00 +0900, Bill Baxter wrote:

 On Fri, Sep 12, 2008 at 11:45 AM, Jarrett Billingsley
 <jarrett.billingsley gmail.com> wrote:
 On Thu, Sep 11, 2008 at 10:35 PM, Sam Hu <samhu.samhu gmail.com> wrote:
 Thanks Jarrett.

 It works now.But I am wondering why does such changes,any special
 reason?

 Thanks again.

tango.math.random.

as in "keep it simple stupid". If so I think I'm going to barf. Please tell me there's some RNG algorithm known as Kiss. Googling didn't turn it up, but maybe my google-fu is just weak. --bb

It's the name of a RNG by Marsaglia. 287 + a simple RNG

Whew! I was afraid Tango had gone all cutesy on us for a while there. Like out with tango.group, in with Tango "Kiss" modules. Seriously. So glad to hear it's just the name of a RNG. Sorry to find out my Google-fu is so weak, though. :-( --bb
Sep 11 2008
prev sibling parent "Bill Baxter" <wbaxter gmail.com> writes:
On Fri, Sep 12, 2008 at 1:06 PM, Jarrett Billingsley
<jarrett.billingsley gmail.com> wrote:

 I was wondering about that Kiss module too.  I really hope it's not
 Kiss as in "keep it simple stupid".  If so I think I'm going to barf.
 Please tell me there's some RNG algorithm known as Kiss.  Googling
 didn't turn it up, but maybe my google-fu is just weak.

 --bb

Get your vomit bag ready. Yes, Marsaglia came up with it and named it, and yes, he named it after "Keep it simple stupid". :P

I figured that was probably the case. But for some reason that doesn't bother me. I guess I don't really expect mathematicians to have any aesthetic sense. :-) I was just afraid Tango was going to start having "Kiss" modules pop up in every package. --bb
Sep 11 2008