Commit Graph

8 Commits

Author SHA1 Message Date
Sebastian Wilhelmi
32241715f4 Updated G_RAND_DOUBLE_TRANSFORM to be more accurate. Redid g_rand_double()
2000-12-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* grand.c: Updated G_RAND_DOUBLE_TRANSFORM to be more
	accurate. Redid g_rand_double() such that it returns 52 bits after
	the point instead of 32 as before. That OTOH requires calling
	g_rand_int() twice. Overhauled g_rand_int_range(), which is easier
	now thanks to the new precision of g_rand_double(). Thanks to
	Sverre Johansen <sj@ifi.uio.no> for the hint.

	* grand.h: Added g_rand_boolean() and g_random_boolean()
	macros. While they could be omitted due to extreme simplicity,
	they make intention clearer in code and are therefore good to have.

	* grand.c, grand.h: Renamed all 'min' and 'max' parameters to'
	begin' and 'end' resp. to avoid making people think, that 'max' is
	included in the interval. 'end' now isn't, whereas 'begin'
	is. That's similar to the use in the STL.

	* glib/glib-sections.txt: Added g_rand_boolean and
	g_random_boolean macros.

	* glib/tmpl/random_numbers.sgml: Updated.
2000-12-19 15:57:53 +00:00
Sebastian Wilhelmi
eb27cad0f0 Added inline documentation.
2000-10-13  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* grand.c: Added inline documentation.

	* docs/refernce/glib/glib-sections.txt: Added misc items.

	* docs/refernce/glib/tmpl/random_numbers.sgml: Documentation for
        the random number generator.
2000-10-13 13:52:47 +00:00
Tim Janik
c9bd7542e1 applied patch from Andreas Persenius <ndap@swipnet.se> that updates the
Wed Jul 26 12:59:31 2000  Tim Janik  <timj@gtk.org>

        * *.[hc]: applied patch from Andreas Persenius <ndap@swipnet.se> that
        updates the license headers to the GNU Lesser General Public License,
        as well as updating the copyright year to 2000.
2000-07-26 11:02:02 +00:00
Sebastian Wilhelmi
028a71701c Fixed bug. Thanks to Marko Kreen <marko@l-t.ee> for reporting that.
2000-04-07  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* grand.c (g_rand_new): Fixed bug. Thanks to Marko Kreen
	<marko@l-t.ee> for reporting that.
2000-04-07 11:44:43 +00:00
Sebastian Wilhelmi
e435032d6e Use /dev/urandom, as it doesn't block, which /dev/random might do. Do not
1999-07-23  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* grand.c (g_rand_new): Use /dev/urandom, as it doesn't block,
	which /dev/random might do. Do not XOR the time, when getting the
	seed form /dev/urandom, as this is good itself. Prevent the
	initial seed from being zero, which causes the PRNG to produce
	only zeros. Hints from Colin Plumb <colin@pgp.com>.
1999-08-19 08:32:03 +00:00
Sebastian Wilhelmi
f80d6cc540 Finally removed the g_random_normal and g_rand_normal functions.
1999-06-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, grand.c: Finally removed the g_random_normal and
	g_rand_normal functions.
1999-06-30 08:10:01 +00:00
Sebastian Wilhelmi
3aa65d30eb Moved struct declaration up. Style fixes.
1999-04-12  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h: Moved struct declaration up. Style fixes.

	* grand.c: Style fixes. Only try to open /dev/random once.

	* tests/rand-test.c (main): New tests; Slight bug fix.
1999-04-12 12:53:37 +00:00
Sebastian Wilhelmi
95aff22dff New files to implement the Mersenne Twister Pseudo Random Number
1999-04-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* grand.c, tests/rand-test.c: New files to implement the Mersenne
	Twister Pseudo Random Number Generator.

	* glib.h, AUTHORS, Makefile.am, tests/Makefile.am: Changed
	accordingly.
1999-04-09 14:40:58 +00:00