public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Brian Gough <bjg@network-theory.co.uk>
To: "Jari Häkkinen" <jari@chiralcomp.com>
Cc: gsl-discuss@sources.redhat.com
Subject: Re: rng question
Date: Wed, 07 Dec 2005 20:07:00 -0000	[thread overview]
Message-ID: <17303.16636.732007.363616@hp2.network-theory.co.uk> (raw)
In-Reply-To: <4396B8AF.7040300@chiralcomp.com>

Jari Häkkinen writes:
 > According to the documentation gsl_rng_max(rng_ returns the maximum 
 > random number the underlying rng can give, and 
 > gsl_rng_uniform_int(rng,gsl_rng_max(rng)) will return 
 > [0,gsl_rng_max(rng)-1]. This will not give the maximum number from the 
 > underlying generator, so I tried 
 > gsl_rng_uniform_int(rng,gsl_rng_max(rng)+1) but this call does not 
 > return (since the second argument becomes 0).

Doesn't it give an exception? (due to division by zero in the expression scale = range / n;)
What platform are you using?

-- 
Brian Gough

Network Theory Ltd,
Publishing Free Software Manuals --- http://www.network-theory.co.uk/

  reply	other threads:[~2005-12-07 20:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-07 10:25 Jari Häkkinen
2005-12-07 20:07 ` Brian Gough [this message]
2005-12-09 13:49   ` Jari Häkkinen
2005-12-17 16:50     ` Brian Gough
2005-12-17 23:58       ` Jari Häkkinen
2008-08-03 23:32 RNG question Robert G. Brown
2008-08-05  9:05 ` Fabian Bastin
2008-08-08 11:12 ` Brian Gough
2008-08-08 12:33   ` Robert G. Brown
2008-08-11 20:47     ` Brian Gough
2008-08-18 21:12     ` Robert G. Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17303.16636.732007.363616@hp2.network-theory.co.uk \
    --to=bjg@network-theory.co.uk \
    --cc=gsl-discuss@sources.redhat.com \
    --cc=jari@chiralcomp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).