basix_doc 0.1
|
00001 00002 /****************************************************************************** 00003 * MODULE : double.cpp 00004 * DESCRIPTION: Syntactic double type constructor 00005 * COPYRIGHT : (C) 2006 Joris van der Hoeven 00006 ******************************************************************************* 00007 * This software falls under the GNU general public license and comes WITHOUT 00008 * ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details. 00009 * If you don't have this file, write to the Free Software Foundation, Inc., 00010 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00011 ******************************************************************************/ 00012 00013 #include <basix/double.hpp> 00014 namespace mmx { 00015 00016 double 00017 uniform_deviate (const double& lo, const double& hi) { 00018 double x= ((double) rand ()) / RAND_MAX; 00019 return lo + (hi - lo) * x; 00020 } 00021 00022 } // namespace mmx