Home
last modified time | relevance | path

Searched refs:n_scale (Results 1 – 19 of 19) sorted by relevance

/php-src/ext/bcmath/libbcmath/src/
H A Ddoaddsub.c45 size_t sum_scale = MAX(n1->n_scale, n2->n_scale); in _bc_do_add()
47 size_t min_scale = MIN(n1->n_scale, n2->n_scale); in _bc_do_add()
57 n1ptr = (char *) (n1->n_value + n1->n_len + n1->n_scale - 1); in _bc_do_add()
58 n2ptr = (char *) (n2->n_value + n2->n_len + n2->n_scale - 1); in _bc_do_add()
62 if (n1->n_scale != min_scale) { in _bc_do_add()
64 for (count = n1->n_scale - min_scale; count > 0; count--) { in _bc_do_add()
69 for (count = n2->n_scale - min_scale; count > 0; count--) { in _bc_do_add()
177 size_t diff_scale = MAX(n1->n_scale, n2->n_scale); in _bc_do_sub()
180 size_t min_scale = MIN(n1->n_scale, n2->n_scale); in _bc_do_sub()
196 if (n1->n_scale != min_scale) { in _bc_do_sub()
[all …]
H A Drmzero.c50 if (num->n_scale == 0) { in bc_rm_trailing_zeros()
54 char *end = num->n_value + num->n_len + num->n_scale - 1; in bc_rm_trailing_zeros()
55 while (*end == 0 && num->n_scale > 0) { in bc_rm_trailing_zeros()
56 num->n_scale--; in bc_rm_trailing_zeros()
H A Draise.c67 rscale = MIN (base->n_scale * exponent, MAX(scale, base->n_scale)); in bc_raise()
72 pwrscale = base->n_scale; in bc_raise()
104 (*result)->n_scale = MIN(scale, (*result)->n_scale); in bc_raise()
113 assert(expo->n_scale == 0); in bc_raise_bc_exponent()
H A Ddivmod.c56 rscale = MAX (num1->n_scale, num2->n_scale + scale); in bc_divmod()
74 (*rem)->n_scale = MIN(scale, (*rem)->n_scale); in bc_divmod()
H A Dround.c41 if (precision >= 0 && num->n_scale <= precision) { in bc_round()
42 if (num->n_scale == precision) { in bc_round()
44 } else if(num->n_scale < precision) { in bc_round()
47 memcpy((*result)->n_value, num->n_value, num->n_len + num->n_scale); in bc_round()
126 size_t count = num->n_len + num->n_scale - rounded_len - 1; in bc_round()
168 bc_num scaled_one = bc_new_num((*result)->n_len, (*result)->n_scale); in bc_round()
H A Drecmul.c248 size_t len1 = n1->n_len + n1->n_scale; in bc_multiply()
249 size_t len2 = n2->n_len + n2->n_scale; in bc_multiply()
250 size_t full_scale = n1->n_scale + n2->n_scale; in bc_multiply()
251 size_t prod_scale = MIN(full_scale, MAX(scale, MAX(n1->n_scale, n2->n_scale))); in bc_multiply()
263 prod->n_scale = prod_scale; in bc_multiply()
275 size_t len1 = n1->n_len + n1->n_scale; in bc_square()
276 size_t full_scale = n1->n_scale + n1->n_scale; in bc_square()
277 size_t prod_scale = MIN(full_scale, MAX(scale, n1->n_scale)); in bc_square()
287 prod->n_scale = prod_scale; in bc_square()
H A Draisemod.c42 if (base->n_scale != 0) { in bc_raisemod()
46 if (expo->n_scale != 0) { in bc_raisemod()
53 if (mod->n_scale != 0) { in bc_raisemod()
62 if (_bc_do_compare(mod, BCG(_one_), mod->n_scale, false) == BCMATH_EQUAL) { in bc_raisemod()
H A Dsqrt.c54 bcmath_compare_result num_cmp_one = bc_compare(local_num, BCG(_one_), local_num->n_scale); in bc_sqrt()
65 size_t rscale = MAX(scale, local_num->n_scale); in bc_sqrt()
77 cscale = local_num->n_scale; in bc_sqrt()
85 guess1->n_scale = 0; in bc_sqrt()
H A Dnearzero.c43 if (scale > num->n_scale) { in bc_is_near_zero()
44 scale = num->n_scale; in bc_is_near_zero()
H A Dadd.c60 sum = bc_new_num (1, MAX(scale_min, MAX(n1->n_scale, n2->n_scale))); in bc_add()
H A Dsub.c60 size_t res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale)); in bc_sub()
H A Dfloor_or_ceil.c32 if (num->n_scale == 0 || result->n_sign == (is_floor ? PLUS : MINUS)) { in bc_floor_or_ceil()
37 size_t count = num->n_scale; in bc_floor_or_ceil()
H A Dnum2str.c43 size_t min_scale = MIN(num->n_scale, scale); in bc_num2str_ex()
67 for (index = num->n_scale; index < scale; index++) { in bc_num2str_ex()
H A Dcompare.c76 size_t n1_scale = MIN(n1->n_scale, scale); in _bc_do_compare()
77 size_t n2_scale = MIN(n2->n_scale, scale); in _bc_do_compare()
H A Dzero.c60 return bc_is_zero_for_scale(num, num->n_scale); in bc_is_zero()
H A Ddiv.c347 if (_bc_do_compare(divisor, BCG(_one_), divisor->n_scale, false) == BCMATH_EQUAL) { in bc_divide()
348 size_t quot_scale = MIN(numerator->n_scale, scale); in bc_divide()
358 char *numeratorend = numeratorptr + numerator->n_len + numerator->n_scale - 1; in bc_divide()
360 size_t numerator_scale = numerator->n_scale; in bc_divide()
363 char *divisorend = divisorptr + divisor->n_len + divisor->n_scale - 1; in bc_divide()
365 size_t divisor_scale = divisor->n_scale; in bc_divide()
H A Dbcmath.h43 size_t n_scale; /* The number of digits after the decimal point. */ member
181 #define bc_num2str(num) bc_num2str_ex((num), (num->n_scale))
H A Dinit.c56 temp->n_scale = scale; in _bc_new_num_nonzeroed_ex_internal()
/php-src/ext/bcmath/
H A Dbcmath.c608 if (bc_exponent->n_scale != 0) { in PHP_FUNCTION()
1029 (*ret)->n_scale = MIN(*scale, (*ret)->n_scale); in bcmath_number_add_internal()
1041 (*ret)->n_scale = MIN(*scale, (*ret)->n_scale); in bcmath_number_sub_internal()
1057 (*ret)->n_scale = MIN(*scale, (*ret)->n_scale); in bcmath_number_mul_internal()
1079 size_t diff = *scale - (*ret)->n_scale; in bcmath_number_div_internal()
1105 if (UNEXPECTED(n2->n_scale != 0)) { in bcmath_number_pow_internal()
1153 size_t diff = *scale - (*ret)->n_scale; in bcmath_number_pow_internal()
1351 ret = bc_compare(n1, n2, MAX(n1->n_scale, n2->n_scale)); in bcmath_number_compare()
1691 ret->n_scale = MIN(scale, ret->n_scale); in PHP_METHOD()
1694 size_t diff = scale - ret->n_scale; in PHP_METHOD()
[all …]

Completed in 32 milliseconds