patchGNU Octave - Patches: patch #8389, Make rand(..., 'single') never...

 
 

patch #8389: Make rand(..., 'single') never return a value of exactly 1 (bug #41742).

Submitted by:  Philipp Kutin <pkutin>
Submitted on:  Mon 10 Mar 2014 10:06:44 PM UTC  
 
Category:  None Priority:  5 - Normal
Status:  Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sun 04 May 2014 12:13:48 AM UTC, comment #3: 

Closing patch as this issue has been reported as a bug.

Rik <rik5>
Project Administrator
Mon 10 Mar 2014 10:23:09 PM UTC, comment #2: 

If a patch fixes a bug, then just attach it to the bug report.  The patch tracker is really intended for additions or changes that are new features, not so much bug fixes.

John W. Eaton <jwe>
Project Administrator
Mon 10 Mar 2014 10:07:57 PM UTC, comment #1: 

This fixes bug #41742 (<- just to have a link here).

Philipp Kutin <pkutin>
Mon 10 Mar 2014 10:06:44 PM UTC, original submission:  
  • liboctave/numeric/randmtzig.c: rewrite randu32() to multiply 2^-32 with a

  random number from 1 to LASTLINT, where LASTLINT is the greatest integer n
  for which (float)(2^-32 * n) < 1.0. Use static assertions to back up this
  claim.

---

Additionally, a test file randfloat_gnu.c is provided, which was used during development.

Philipp Kutin <pkutin>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #30850:  randu32_no_exact_1.patch added by pkutin (2KiB - text/x-patch)
file #30851:  randfloat_gnu.c added by pkutin (3KiB - text/x-c)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by pkutin (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-05-04 rik5 StatusNone => Bug
        Open/ClosedOpen => Closed
    2014-03-10 pkutin Attached File- => Added randu32_no_exact_1.patch, #30850
        Attached File- => Added randfloat_gnu.c, #30851

    Back to the top


    Powered by Savane 3.5