[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #48995] rand, rande (1.1)
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #48995] rand, rande (1.1) |
Date: |
Tue, 6 Sep 2016 22:57:27 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0 |
Update of bug #48995 (project octave):
Open/Closed: Open => Closed
_______________________________________________________
Follow-up Comment #3:
That does not seem to be an error in Octave or Matlab.
For any function that accepts a size argument, the argument is allowed to be a
floating point number, and the truncated integer part is used as the size
value (number of elements, number of columns or rows, etc).
>> size (ones (2.9))
ans =
2 2
>> size (rand (3.8))
ans =
3 3
The rand and rande functions take no parameter, only size. But the randg and
randp functions take both a parameter and a size.
>> size (rand (2.2))
ans =
2 2
>> size (rande (2.2))
ans =
2 2
>> size (randg (1, 2.2))
ans =
2 2
>> size (randp (1, 2.2))
ans =
2 2
The randg doc string seems to be wrong, since it doesn't document the required
parameter. But the behavior is correct.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?48995>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/