Updated G_RAND_DOUBLE_TRANSFORM to be more accurate. Redid g_rand_double()
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Tue, 19 Dec 2000 15:57:53 +0000 (15:57 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Tue, 19 Dec 2000 15:57:53 +0000 (15:57 +0000)
commit32241715f42b437299282367f39becb0c8602d23
tree435cfa8cad02b44a5a38f5fb9308dcc3b59ac805
parent2fb47703e2929d300a3f804268a36d50543b4a2c
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.
15 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/ChangeLog
docs/reference/glib/glib-sections.txt
docs/reference/glib/tmpl/random_numbers.sgml
glib/grand.c
glib/grand.h
grand.c
grand.h