php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76146 lcg_value doesn't specify if 1 is included or excluded
Submitted: 2018-03-25 16:43 UTC Modified: 2018-03-27 22:04 UTC
From: looris at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2018-03-25 16:43 UTC] looris at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.lcg-value
---

The manual page of lcg_value() does not specify if the value is between 0 and 1 inclusive or exclusive.

While it's very safe to assume that 0 is inclusive, it's definitely not obvious if 1 is or isn't.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-25 17:03 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Documentation problem +Package: Math related
 [2018-03-27 22:04 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=344574
Log: Fix bug #76146 by noting the apparent return interval for lcg_value().
 [2018-03-27 22:04 UTC] aharvey@php.net
-Status: Verified +Status: Closed -Package: Math related +Package: Documentation problem -Assigned To: +Assigned To: aharvey
 [2018-03-27 22:04 UTC] aharvey@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

The tests expect any value between 0.0 and 1.0 inclusive, so I've updated the manual to reflect that too. The actual code is somewhat inscrutable, although if anyone really knows their way around LCGs and wants to pull it apart, I'm happy to update it again later.
 [2020-02-07 06:05 UTC] phpdocbot@php.net
Automatic comment on behalf of aharvey
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=2643e3d58b45edf1018c5721861408b51c68bce7
Log: Fix bug #76146 by noting the apparent return interval for lcg_value().
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 02:00:02 2026 UTC