Re: cvs: php4 /ext/interbase interbase.c
| From: | derick@php.net | Date: | Tue, 19 Mar 2002 15:49:14 +0000 |
| Subject: | Re: cvs: php4 /ext/interbase interbase.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-10423@lists.php.net to get a copy of this message | ||
Hello Daniela,
I thought that I fixed it already:
http://news.php.net/article.php?group=php.cvs&article=9742
And you reverted now this note (from the same bug):
[6 Mar 6:21am] giancarlo@niccolai.ws
Hi; I am the original fixer...
Noticed that
for (i = 0; i < -scale; i++)
number /= 10;
can be substituted with
number /= - 10 * scale;
with a boost on performance. (remember that interbase
stores the "scale" as a negative number).
can you have a look at it?
Derick
On Tue, 19 Mar 2002, Daniela Mariaschi wrote:
> daniela Tue Mar 19 10:29:18 2002 EDT
>
> Modified files:
> /php4/ext/interbase interbase.c
> Log:
> fixed floating number incorrectly rendered (as mentioned by giancarlo@niccolai.ws in BUG
> #14755)
>
> Index: php4/ext/interbase/interbase.c
> diff -u php4/ext/interbase/interbase.c:1.80 php4/ext/interbase/interbase.c:1.81
> --- php4/ext/interbase/interbase.c:1.80 Sat Mar 16 13:43:41 2002
> +++ php4/ext/interbase/interbase.c Tue Mar 19 10:29:17 2002
> @@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: interbase.c,v 1.80 2002/03/16 18:43:41 wez Exp $ */
> +/* $Id: interbase.c,v 1.81 2002/03/19 15:29:17 daniela Exp $ */
>
>
> /* TODO: Arrays, roles?
> @@ -595,7 +595,7 @@
>
> php_info_print_table_start();
> php_info_print_table_row(2, "Interbase Support", "enabled");
> - php_info_print_table_row(2, "Revision", "$Revision: 1.80 $");
> + php_info_print_table_row(2, "Revision", "$Revision: 1.81 $");
> #ifdef COMPILE_DL_INTERBASE
> php_info_print_table_row(2, "Dynamic Module", "yes");
> #endif
> @@ -1787,13 +1787,14 @@
> val->type = IS_STRING;
>
> if (scale) {
> - int i, len;
> - char dt[20];
> + int j, f = 1;
> double number = (double) ((ISC_INT64) (*((ISC_INT64 *)data)));
> -
> - number /= - 10 * scale;
> + char dt[20];
> + for (j = 0; j < -scale; j++) {
> + f *= 10;
> + }
> sprintf(dt, "%%0.%df", -scale);
> - val->value.str.len = sprintf (string_data, dt, number);
> + val->value.str.len = sprintf (string_data, dt, number/f );
> } else {
> val->value.str.len = sprintf (string_data, "%Ld",
> (ISC_INT64) (*((ISC_INT64 *)data)));
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
-----------------------------------------------------------------------
PHP: Scripting the Web - derick@php.net
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
-----------------------------------------------------------------------