bugGNU Octave - Bugs: bug #50256, Wrong data type for rand...


bug #50256: Wrong data type for rand ('twister')

Submitted by:  Avinoam Kalma <avinoam>
Submitted on:  Wed 08 Feb 2017 06:41:17 PM UTC  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Need InfoAssigned to: John W. Eaton <jwe>
Originator Name: AvinoamOpen/Closed: Open
Release: 4.2.0Operating System: Any

Add a New Comment(Rich Markup)

You are not logged in

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


Thu 09 Feb 2017 09:35:17 AM UTC, comment #4:


Thu 09 Feb 2017 01:01:34 AM UTC, comment #3:

The internal state is already a uint32 array, but then we convert it to a double precision ColumnVector to store it. Then if we set the state from one of these saved states, we convert it back. I think we could simplify this by saving the state as a uint32 array instead. I can work on that.

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Thu 09 Feb 2017 12:36:06 AM UTC, comment #2:

Does Matlab return uint32?

And if it does, the simplest thing would be to cast the double values used internally in C++ to uint32_t at the time a value is returned from rand.

Rik <rik5>
Project Administrator
Wed 08 Feb 2017 09:27:41 PM UTC, comment #1:

Actually, K should be 625x1 uint32, and not 625x1 double.

Avinoam Kalma <avinoam>
Project Member
Wed 08 Feb 2017 06:41:17 PM UTC, original submission:

While trying to understand bug #42557:

K should be uint32, but it is double in Octave. How to change it?

Avinoam Kalma <avinoam>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

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 jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by avinoam (Submitted the item)
  • -unavailable- added by avinoam

    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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 09 Feb 2017 01:01:34 AM UTCjweAssigned toNone=>jwe
    Thu 09 Feb 2017 12:36:06 AM UTCrik5StatusNone=>Need Info
    Wed 08 Feb 2017 06:41:17 PM UTCavinoamCarbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1