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

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

[Octave-patch-tracker] [patch #8389] Make rand(..., 'single') never retu


From: Philipp Kutin
Subject: [Octave-patch-tracker] [patch #8389] Make rand(..., 'single') never return a value of exactly 1 (bug #41742).
Date: Mon, 10 Mar 2014 22:06:46 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0

URL:
  <http://savannah.gnu.org/patch/?8389>

                 Summary: Make rand(..., 'single') never return a value of
exactly 1 (bug #41742).
                 Project: GNU Octave
            Submitted by: pkutin
            Submitted on: Mon 10 Mar 2014 10:06:44 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

* 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.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 10 Mar 2014 10:06:44 PM GMT  Name: randu32_no_exact_1.patch  Size:
2kB   By: pkutin

<http://savannah.gnu.org/patch/download.php?file_id=30850>
-------------------------------------------------------
Date: Mon 10 Mar 2014 10:06:44 PM GMT  Name: randfloat_gnu.c  Size: 3kB   By:
pkutin

<http://savannah.gnu.org/patch/download.php?file_id=30851>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8389>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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