# Improved logarithm of base 2|10 of standard math function

- Thread: https://externals.io/message/76510
- Original archive: https://news-web.php.net/php.internals/76510
- Started by Marc Bennewitz on 2014-08-14T09:43:27+00:00
- Messages: 10
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #76510 — Marc Bennewitz — 2014-08-14T09:43:27+00:00

URL: https://externals.io/message/76510#76510

Hi internals,

I have created a PR to improve the base 2 and base 10 of the standard 
math function "log" to reduce rounding errors.

Internally on log(x, 2) the native C function log2(x) and on log(x, 10) 
the native C function log10(x) will be called.

The PR is open since april without any comments!
Please please please someone there to merge this.

PS:
Because of after this PR the following will be the same in PHP log10(x) 
=== log10(x) the function log10 is needless and could be 
deprecated/removed. I will create an RFC if this PR was merged.

Marc

---

## #76511 — Marc Bennewitz — 2014-08-14T09:44:39+00:00

URL: https://externals.io/message/76510#76511 · In reply to: #76510

forgotten the link:
https://github.com/php/php-src/pull/658


> Hi internals,
>
> I have created a PR to improve the base 2 and base 10 of the standard
> math function "log" to reduce rounding errors.
>
> Internally on log(x, 2) the native C function log2(x) and on log(x, 10)
> the native C function log10(x) will be called.
>
> The PR is open since april without any comments!
> Please please please someone there to merge this.
>
> PS:
> Because of after this PR the following will be the same in PHP log10(x)
> === log10(x) the function log10 is needless and could be
> deprecated/removed. I will create an RFC if this PR was merged.
>
> Marc

---

## #76518 — Sara Golemon — 2014-08-14T15:29:13+00:00

URL: https://externals.io/message/76510#76518 · In reply to: #76511

> forgotten the link:
> https://github.com/php/php-src/pull/658
>
>
> 
> > […]
>
This seems entirely reasonable and would be covered by existing unit
tests.   No user-impacting effect (beyond being more precise/correct
output).  I'll push this after my Dr appointment today if nobody has
beaten me to it.

-Sara

---

## #76522 — Marc Bennewitz — 2014-08-14T17:47:04+00:00

URL: https://externals.io/message/76510#76522 · In reply to: #76518

> 
> > […]
> This seems entirely reasonable and would be covered by existing unit
> tests.   No user-impacting effect (beyond being more precise/correct
> output).  I'll push this after my Dr appointment today if nobody has
> beaten me to it.

Nice to see it's merged - thanks!

> 
> -Sara

---

## #76566 — Marc Bennewitz — 2014-08-15T18:57:21+00:00

URL: https://externals.io/message/76510#76566 · In reply to: #76518

Sara,

shouldn't it be merged into the branches PHP-5.4, PHP-5.5 as well as
PHP-5.6 and shouldn't there an info in the NEWS file? It's currently
only merged to master.

Marc


> 
> > […]
> This seems entirely reasonable and would be covered by existing unit
> tests.   No user-impacting effect (beyond being more precise/correct
> output).  I'll push this after my Dr appointment today if nobody has
> beaten me to it.
> 
> -Sara

---

## #76570 — Andrea Faulds — 2014-08-15T20:39:48+00:00

URL: https://externals.io/message/76510#76570 · In reply to: #76566

> Sara,
> 
> shouldn't it be merged into the branches PHP-5.4, PHP-5.5 as well as
> PHP-5.6 and shouldn't there an info in the NEWS file? It's currently
> only merged to master.
> 
> Marc

There might be an argument against adding to 5.4 and 5.5 in that code may now give slightly different results from before, and it’s not really a bugfix as there was no bug.
--
Andrea Faulds
http://ajf.me/

---

## #76588 — Pierre Joye — 2014-08-16T11:18:45+00:00

URL: https://externals.io/message/76510#76588

>
>
> 
> > […]
>
>
> Is the master branch the current 5.6 branch or should it be merged into the
> PHP-5.6 branch to go in there?

Master targets 7. 5.6 has its own branch.

-- 
Pierre

@pierrejoye | http://www.libgd.org

---

## #76608 — Sara Golemon — 2014-08-17T14:55:05+00:00

URL: https://externals.io/message/76510#76608 · In reply to: #76566

> shouldn't it be merged into the branches PHP-5.4, PHP-5.5 as well as
> PHP-5.6 and shouldn't there an info in the NEWS file? It's currently
> only merged to master.
>
I opted for master-only on the grounds that while it's an improvement,
it's not really a bugfix, and released versions (or versions as near
to release as 5.6 is) should be bug-fix only.  I know there's an
argument for this *being* a bug-fix, but...

If a consensus feels it should be merged back I won't object.

-Sara

---

## #76671 — Stas Malyshev — 2014-08-18T22:41:45+00:00

URL: https://externals.io/message/76510#76671 · In reply to: #76608

Hi!

> I opted for master-only on the grounds that while it's an improvement,
> it's not really a bugfix, and released versions (or versions as near
> to release as 5.6 is) should be bug-fix only.  I know there's an
> argument for this *being* a bug-fix, but...
> 
> If a consensus feels it should be merged back I won't object.

I think we can have it in 5.6 and 5.5. 5.4 being very close to
security-only (with the switch technically being already past due) I'd
not merge something that works without the fix back there.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/

---

## #76742 — Marc Bennewitz — 2014-08-20T20:21:18+00:00

URL: https://externals.io/message/76510#76742 · In reply to: #76671

> Hi!
> 
> > […]
> 
> I think we can have it in 5.6 and 5.5. 5.4 being very close to
> security-only (with the switch technically being already past due) I'd
> not merge something that works without the fix back there.
> 

5.5 and 5.6 would be very OK for me :)
