octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #64079] rand state changes display format with


From: anonymous
Subject: [Octave-bug-tracker] [bug #64079] rand state changes display format without user's knowledge
Date: Thu, 20 Apr 2023 12:02:49 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64079>

                 Summary: rand state changes display format without user's
knowledge
                   Group: GNU Octave
               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: 
             Open/Closed: Open
                 Release: 8.1.0
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 20 Apr 2023 04:02:47 PM UTC By: Anonymous
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









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64079>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]