Mercurial > hg > octave-terminal
changeset 5782:96cd81ed579e
[project @ 2006-05-02 21:36:02 by jwe]
author | jwe |
---|---|
date | Tue, 02 May 2006 21:36:50 +0000 |
parents | faafc2d98b8d |
children | 2a9089b47dc2 |
files | gdbinit.in src/ChangeLog src/DLD-FUNCTIONS/rand.cc |
diffstat | 3 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/gdbinit.in @@ -0,0 +1,1 @@ +set args --path="%top_srcdir%/scripts//:%builddir%/src//:"
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-05-02 David Bateman <dbateman@free.fr> + + * DLD-FUNCTIONS/rand.cc (do_rand): Require real scalar for seed. + 2006-05-01 John W. Eaton <jwe@octave.org> * error.h (Vwarning_option): Delete.
--- a/src/DLD-FUNCTIONS/rand.cc +++ b/src/DLD-FUNCTIONS/rand.cc @@ -228,10 +228,15 @@ if (ts == "seed") { - double d = args(idx+1).double_value (); + if (args(idx+1).is_real_scalar ()) + { + double d = args(idx+1).double_value (); - if (! error_state) - octave_rand::seed (d); + if (! error_state) + octave_rand::seed (d); + } + else + error ("%s: seed must be a real scalar", fcn); } else if (ts == "state" || ts == "twister") {