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.
This commit is contained in:
Sebastian Wilhelmi
2000-12-19 15:57:53 +00:00
committed by Sebastian Wilhelmi
parent 2fb47703e2
commit 32241715f4
15 changed files with 317 additions and 158 deletions

View File

@@ -1,3 +1,10 @@
2000-12-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/glib-sections.txt: Added g_rand_boolean and
g_random_boolean macros.
* glib/tmpl/random_numbers.sgml: Updated.
Tue Dec 5 15:41:23 2000 Owen Taylor <otaylor@redhat.com>
* glib/Makefile.am glib/mainloop-states*: add images