bugGNU Octave - Bugs: bug #64079, rand state changes display format...

 
 

bug #64079: rand state changes display format without user's knowledge

Submitter:  None
Submitted:  Thu 20 Apr 2023 04:02:47 PM UTC
   
 
Category:  Other Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  None Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 8.1.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 20 Apr 2023 04:02:47 PM UTC, original submission:  

Calling rand without setting the state gives 4 decimal places. But calling rand ('state') changes the format to 6 or more decimal places. Bug! rand should not change display format.


>> rand (1, 10)
ans =
   0.1618   0.8249   0.2521   0.1298   0.8974   0.4344   0.6740   0.7060   0.4313   0.1419

>> rand (1, 10)
ans =
   0.1844   0.8281   0.5084   0.7845   0.2116   0.7141   0.5542   0.3575   0.9797   0.7155

>> rand (1, 10)
ans =
   0.4220   0.5890   0.3387   0.8954   0.8700   0.6635   0.7760   0.3916   0.9085   0.7271


>> rand ('state', 1)
>> rand (1, 10)
ans =
   0.134364   0.847434   0.763775   0.255069   0.495435   0.449491   0.651593   0.788723   0.093860   0.028347

>> rand (1, 10)
ans =
   8.3577e-01   4.3277e-01   7.6228e-01   2.1061e-03   4.4539e-01   7.2154e-01   2.2876e-01   9.4527e-01   9.0143e-01   3.0590e-02

>> rand (1, 10)
ans =
   0.025446   0.541412   0.939149   0.381204   0.216599   0.422117   0.029041   0.221692   0.437888   0.495812

>> rand (1, 10)
ans =
   0.233084   0.230867   0.218781   0.459603   0.289782   0.021490   0.837578   0.556454   0.642294   0.185906


Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only group members can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.14-f13d.
Corresponding source code