#define IS_CONSTANT 8
#define IS_CONSTANT_ARRAY 9
-/* Special data type to temporarily mark large numbers */
-#define FLAG_IS_BC 10 /* for parser internal use only */
-
/* Ugly hack to support constants as static array indices */
#define IS_CONSTANT_INDEX 0x80
case IS_DOUBLE:
case IS_LONG:
break;
-#if 0 && HAVE_BCMATH
- case FLAG_IS_BC:
- op->type = IS_DOUBLE; /* may have lost significant digits */
- break;
-#endif
default:
op->value.lval = strtol(op->value.str.val, NULL, 10);
op->type = IS_LONG;
case IS_DOUBLE: \
case IS_LONG: \
break; \
- case FLAG_IS_BC: \
- (holder).type = IS_DOUBLE; /* may have lost significant digits */ \
- break; \
default: \
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
(holder).type = IS_LONG; \
op1->type = IS_DOUBLE;
efree(strval); /* should never be empty_string */
break;
-#if 0
- case FLAG_IS_BC:
- /* Not implemented */
-#endif
default:
/* Perl style string increment */
increment_string(op1);
if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1, 0)) &&
(ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2, 0))) {
-#if 0&&HAVE_BCMATH
- if ((ret1==FLAG_IS_BC) || (ret2==FLAG_IS_BC)) {
- bc_num first, second;
-
- /* use the BC math library to compare the numbers */
- init_num(&first);
- init_num(&second);
- str2num(&first, s1->value.str.val, 100); /* this scale should do */
- str2num(&second, s2->value.str.val, 100); /* ditto */
- result->value.lval = bc_compare(first, second);
- result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
- result->type = IS_LONG;
- free_num(&first);
- free_num(&second);
- } else
-#endif
if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) {
if (ret1!=IS_DOUBLE) {
dval1 = strtod(s1->value.str.val, NULL);
errno=0;
local_dval = strtod(str, &end_ptr_double);
- if (errno!=ERANGE) {
+ if (errno != ERANGE) {
if (end_ptr_double == str+length) { /* floating point string */
- if (! zend_finite(local_dval)) {
+ if (!zend_finite(local_dval)) {
/* "inf","nan" and maybe other weird ones */
return 0;
}
if (dval) {
*dval = local_dval;
}
-#if 0&&HAVE_BCMATH
- if (length>16) {
- register char *ptr=str, *end=str+length;
-
- while (ptr<end) {
- switch (*ptr++) {
- case 'e':
- case 'E':
- /* scientific notation, not handled by the BC library */
- return IS_DOUBLE;
- break;
- default:
- break;
- }
- }
- return FLAG_IS_BC;
- } else {
- return IS_DOUBLE;
- }
-#else
return IS_DOUBLE;
-#endif
}
} else {
end_ptr_double=NULL;