php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52457 A natural number is any positive non-zero integer
Submitted: 2010-07-27 15:33 UTC Modified: 2010-09-21 17:51 UTC
From: hm2k@php.net Assigned: markskilbeck (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hm2k@php.net
New email:
PHP Version: OS:

 

 [2010-07-27 15:33 UTC] hm2k@php.net
Description:
------------
As a user rightly pointed out a couple of years ago (http://www.php.net/manual/en/function.bcpowmod.php#73406), the statement is incorrectly written:

"Note: Because this method uses the modulus operation, non-natural numbers may give unexpected results. A natural number is any positive non-zero integer. "

Which is directly from the documentation, meanwhile it is else where defined as:

"In mathematics, there are two conventions for the set of natural numbers: it is either the set of positive integers {1, 2, 3, ...} according to the traditional definition; or the set of non-negative integers {0, 1, 2, ...} according to a definition first appearing in the nineteenth century."

@see http://en.wikipedia.org/wiki/Natural_number

Perhaps it should read:

"Note: This method uses the modulus operation, which may produce unexpected results if supplied with anything other than a non-zero positive integer."


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-05 03:05 UTC] cataphract@php.net
"non-zero positive integer" is the part that doesn't make sense. 0 is neither positive nor negative. It should read "a natural number is, for this purpose, any positive integer (0 is therefore not included)".
 [2010-08-05 15:18 UTC] hm2k@php.net
Agreed, there's something not quite right, I just couldn't put my finger on it.

Cheers.
 [2010-08-08 21:14 UTC] degeberg@php.net
Why not just remove the reference to "natural numbers" and just say that it 
requires positive integers? This is completely unambiguous. That page doesn't 
otherwise use the term "natural numbers".
 [2010-08-26 17:36 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&revision=302813
Log: Changed confusing "positive non-zero integer" note (re #52457)
 [2010-09-21 17:51 UTC] markskilbeck@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: markskilbeck
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC