Lines Matching refs:num

21 void bc_round(bc_num num, zend_long precision, zend_long mode, bc_num *result)  in bc_round()  argument
38 if (precision < 0 && num->n_len < (size_t) (-(precision + Z_L(1))) + 1) { in bc_round()
49 if (num->n_sign == MINUS) { in bc_round()
56 if (num->n_sign == PLUS) { in bc_round()
68 if (bc_is_zero(num)) { in bc_round()
80 (*result)->n_sign = num->n_sign; in bc_round()
85 if (precision >= 0 && num->n_scale <= precision) { in bc_round()
86 if (num->n_scale == precision) { in bc_round()
87 *result = bc_copy_num(num); in bc_round()
88 } else if(num->n_scale < precision) { in bc_round()
89 *result = bc_new_num(num->n_len, precision); in bc_round()
90 (*result)->n_sign = num->n_sign; in bc_round()
91 memcpy((*result)->n_value, num->n_value, num->n_len + num->n_scale); in bc_round()
100 size_t rounded_len = num->n_len + precision; in bc_round()
110 *result = bc_new_num(num->n_len, precision > 0 ? precision : 0); in bc_round()
111 memcpy((*result)->n_value, num->n_value, rounded_len); in bc_round()
113 (*result)->n_sign = num->n_sign; in bc_round()
115 const char *nptr = num->n_value + rounded_len; in bc_round()
139 if (num->n_sign != PLUS) { in bc_round()
148 if (num->n_sign != MINUS) { in bc_round()
170 size_t count = num->n_len + num->n_scale - rounded_len - 1; in bc_round()
189 if (rounded_len == 0 || num->n_value[rounded_len - 1] % 2 == 0) { in bc_round()
195 if (rounded_len != 0 && num->n_value[rounded_len - 1] % 2 == 1) { in bc_round()
208 tmp = bc_new_num(num->n_len + 1, 0); in bc_round()
210 tmp->n_sign = num->n_sign; in bc_round()