if (cfg_get_long("bcmath.scale", &bc_precision) == FAILURE) {
bc_precision = 0;
}
-
+ if(bc_precision<0) bc_precision=0;
bc_init_numbers(TSRMLS_C);
return SUCCESS;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
- scale = (int) Z_LVAL_PP(scale_param);
+ scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
break;
default:
WRONG_PARAM_COUNT;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
- scale = (int) Z_LVAL_PP(scale_param);
+ scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
break;
default:
WRONG_PARAM_COUNT;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
- scale = (int) Z_LVAL_PP(scale_param);
+ scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
break;
default:
WRONG_PARAM_COUNT;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
- scale = (int) Z_LVAL_PP(scale_param);
+ scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
break;
default:
WRONG_PARAM_COUNT;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
- scale = (int) Z_LVAL_PP(scale_param);
+ scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
break;
default:
WRONG_PARAM_COUNT;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
- scale = (int) Z_LVAL_PP(scale_param);
+ scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
break;
default:
WRONG_PARAM_COUNT;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
- scale = (int) Z_LVAL_PP(scale_param);
+ scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
break;
default:
WRONG_PARAM_COUNT;
}
convert_to_long_ex(new_scale);
- bc_precision = Z_LVAL_PP(new_scale);
+ bc_precision = (Z_LVAL_PP(new_scale)<0) ? 0 : Z_LVAL_PP(new_scale);
+
RETURN_TRUE;
}
/* }}} */