# Fixing arbitrary 40 digit max precision in printf code

- Thread: https://externals.io/message/43794
- Original archive: https://news-web.php.net/php.internals/43794
- Started by Rasmus Lerdorf on 2009-04-29T04:09:44+00:00
- Messages: 1
- 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

---

## #43794 — Rasmus Lerdorf — 2009-04-29T04:09:44+00:00

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

Prompted by
http://www.exploringbinary.com/print-precision-of-dyadic-fractions-varies-by-language/

I agree with the author that 40 is a weird arbitrary limit to impose
here.  As he writes, the smallest float that will fit in a double is
1074 decimal digits and the largest is 53.  I don't see a reason we
shouldn't be in line with Perl and C here.

It's a couple of minor constant size changes in main/snprintf and
ext/standard/formatted_print.c plus a test case fix.

-Rasmus
