(
Jump to the original submission)
Tue 08 Sep 2015 08:44:46 AM UTC, comment #6:
The issues regarding different input data types should be fixed by the changeset now.
http://hg.savannah.gnu.org/hgweb/octave/rev/f515bac7c7c1
Update randi.m to this version:
http://hg.savannah.gnu.org/hgweb/octave/file/f515bac7c7c1/scripts/general/randi.m
Any feedback is welcome!
|
Mon 07 Sep 2015 10:16:39 PM UTC, comment #5:
I confirm this function was never intended for integer input "imax". The fix from https://savannah.gnu.org/bugs/?45879#comment1 works for me too, but I think this function needs a small makeover, see https://savannah.gnu.org/bugs/?45879#comment3 .
|
Mon 07 Sep 2015 07:50:49 PM UTC, comment #4:
The fix in comment #1 fix this
|
Mon 07 Sep 2015 05:28:30 PM UTC, comment #3:
Another little bug.
class(randi(int32(10),'double'))
ans = int32
In Matlab the result is ans = double.
|
Sat 05 Sep 2015 10:24:30 PM UTC, comment #2:
I think random numbers are incredibly tricky to get right :)
http://akbar.marlboro.edu/~mahoney/courses/Fall01/computation/NumeralRecipesCpdf/c7-1.pdf
|
Sat 05 Sep 2015 09:08:14 PM UTC, comment #1:
The problem is in the line
in randi. Changing to
will solve the problem.
what do you think?
|
Sat 05 Sep 2015 01:18:57 PM UTC, original submission:
>> max(randi(int64(100),1000,1))
ans = 101
Same result with int8, 16, 32 and unsigned.
|
(Note: upload size limit is set to 16384 kB, after insertion of the required
escape characters.)
Attach File(s):
Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Follow 6 latest changes.