Lines Matching refs:num
21 void bc_round(bc_num num, zend_long precision, zend_long mode, bc_num *result) in bc_round() argument
36 if (precision < 0 && num->n_len < (size_t) (-(precision + Z_L(1))) + 1) { in bc_round()
41 if (precision >= 0 && num->n_scale <= precision) { in bc_round()
42 if (num->n_scale == precision) { in bc_round()
43 *result = bc_copy_num(num); in bc_round()
44 } else if(num->n_scale < precision) { in bc_round()
45 *result = bc_new_num(num->n_len, precision); in bc_round()
46 (*result)->n_sign = num->n_sign; in bc_round()
47 memcpy((*result)->n_value, num->n_value, num->n_len + num->n_scale); in bc_round()
56 size_t rounded_len = num->n_len + precision; in bc_round()
66 *result = bc_new_num(num->n_len, precision > 0 ? precision : 0); in bc_round()
67 memcpy((*result)->n_value, num->n_value, rounded_len); in bc_round()
69 (*result)->n_sign = num->n_sign; in bc_round()
71 const char *nptr = num->n_value + rounded_len; in bc_round()
95 if (num->n_sign != PLUS) { in bc_round()
104 if (num->n_sign != MINUS) { in bc_round()
126 size_t count = num->n_len + num->n_scale - rounded_len - 1; in bc_round()
145 if (rounded_len == 0 || num->n_value[rounded_len - 1] % 2 == 0) { in bc_round()
151 if (rounded_len != 0 && num->n_value[rounded_len - 1] % 2 == 1) { in bc_round()
164 tmp = bc_new_num(num->n_len + 1, 0); in bc_round()
166 tmp->n_sign = num->n_sign; in bc_round()