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

index d7fcb4be4a7739b2d74bbf407007d58f0fbf9cc0..a84513c66403939603ca864efe8bd3913150b7ff 100644 (file)
@@ -358,6 +358,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;
        }