]> granicus.if.org Git - php/commitdiff
Added an E_NOTICE when precision value is truncated
authorIlia Alshanetsky <iliaa@php.net>
Tue, 20 Jan 2009 18:02:35 +0000 (18:02 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 20 Jan 2009 18:02:35 +0000 (18:02 +0000)
ext/standard/formatted_print.c

index ac32dae598c352b330509007f7122e8aa7abe3fd..a6b8af783dc63f1dd5b1b67bb42c10d9ca661a6e 100644 (file)
@@ -225,6 +225,7 @@ php_sprintf_appenddouble(char **buffer, int *pos,
        if ((adjust & ADJ_PRECISION) == 0) {
                precision = FLOAT_PRECISION;
        } else if (precision > MAX_FLOAT_PRECISION) {
+               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Requested precision of %d digits was truncated to PHP maximum of %d digits", precision, MAX_FLOAT_PRECISION);
                precision = MAX_FLOAT_PRECISION;
        }