bugGNU Octave - Bugs: bug #51933, Documentation of function rand and...

 
 

bug #51933: Documentation of function rand and others

Submitted by:  Ernst Reissner <ernstreissner>
Submitted on:  Mon 04 Sep 2017 01:33:33 PM UTC  
 
Category: DocumentationSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 05 Sep 2017 02:27:05 AM UTC, comment #2:

Confirmed. If you can prepare a patch I can review.

Rik <rik5>
Project Administrator
Mon 04 Sep 2017 01:46:11 PM UTC, comment #1:

Ah i made a mistake:
rand works only with CLASS=double or single,
which is another difference to eye
which works for integer types like uint64
and even for 'logical' type.

But this is another reason not just to write,
that the arguments are as those for eye. !!!!

Ernst Reissner <ernstreissner>
Mon 04 Sep 2017 01:33:33 PM UTC, original submission:

The documentation of function rand is incomplete.
In addition it is outdated, because matlab moved a little bit.
I suggest to update documentation first
before, somewhere in future upgrade for sake of matlab compatibility.

I think, a sentence like

is not what the user wants to read, it should be more explicit,
and it should be correct.

In detail:
1.
The case rand() without argument behaves like rand(1)
which is not documented.
This is like eye().

rand(2,3,4) is documented and is allowed whereas eye(2,3,4) is not (eye is restricted to two arguments maximum).
Accordingly, rand([2,3,4]) is allowed and is the same as rand(2,3,4)

These two cases are not like eye which shows,
that we need a separate description.

The return values are missing in most cases:
so rand(n) must be replaced by m=rand(n).

As documented for eye, the variants
are also allowed with additional argument CLASS as
What is also missing is an explicit enumeration of the allowed values for CLASS, namely

'double', 'single', 'logical', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', or 'uint64',

in particular: logical!!!!

It does not make sense, to state the variants with seed and state before all those are described becaues

rand('state','double') does not work!!

So we have to mention first:

Then one has to describe the variants

for which it is really true, that V is a vector
and the other variants have no return value.
What is missing is the documentation for second argument 'reset'
which i found nowhere.

Accordingly for 'seed' replacing 'state'.

For the other variants,

Ernst Reissner <ernstreissner>

 

(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

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by ernstreissner (Submitted the item)
  • -unavailable- added by ernstreissner
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 05 Sep 2017 02:27:05 AM UTCrik5StatusNone=>Confirmed
    Mon 04 Sep 2017 01:33:33 PM UTCernstreissnerCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1