Fix mismatch between srand/srand48 and rand/rand48.
Because only the configure macros of spot::srand() had been updated to the introduction of _config.h, rand() was used even if drand48() was available, and yet srand48() was being called by spot::srand(). The consequence is that setting the seed with srand48() had not effect on the value returned by rand(). Reported by Etienne Renault. * src/misc/random.cc (drand): Fix configure macros used.
This commit is contained in:
parent
a2893520ca
commit
b9afd8e705
1 changed files with 6 additions and 3 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
// Copyright (C) 2004, 2011 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// -*- coding: utf-8 -*-
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// Copyright (C) 2011, 2012 Laboratoire de Recherche et Développement
|
||||||
|
// de l'Epita (LRDE).
|
||||||
|
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
|
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
// et Marie Curie.
|
// et Marie Curie.
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -38,7 +41,7 @@ namespace spot
|
||||||
double
|
double
|
||||||
drand()
|
drand()
|
||||||
{
|
{
|
||||||
#if HAVE_SRAND48 && HAVE_DRAND48
|
#if SPOT_HAVE_SRAND48 && SPOT_HAVE_DRAND48
|
||||||
return ::drand48();
|
return ::drand48();
|
||||||
#else
|
#else
|
||||||
double r = ::rand();
|
double r = ::rand();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue