/PHP-8.4/ext/standard/tests/math/ |
H A D | number_format_basiclong_64bit.phpt | 40 echo "... with precision " . $precision . ": "; 56 ... with precision -20: string(1) "0" 67 ... with precision -20: string(1) "0" 74 ... with precision -10: string(1) "0" 75 ... with precision -11: string(1) "0" 76 ... with precision -17: string(1) "0" 77 ... with precision -19: string(1) "0" 78 ... with precision -20: string(1) "0" 85 ... with precision -10: string(1) "0" 86 ... with precision -11: string(1) "0" [all …]
|
H A D | round_modes.phpt | 55 precision: -1 75 precision: 0 95 precision: 1 115 precision: 2 135 precision: 10 156 precision: -1 176 precision: 0 196 precision: 1 216 precision: 2 277 precision: 0 [all …]
|
H A D | round_basic.phpt | 4 precision=14 19 $precision = array(2, 35 echo "...with precision $precision[$j]-> "; 72 ...with precision 1-> float(123.5) 73 ...with precision -> float(123) 75 ...with precision 2-> float(-4.57) 88 ...with precision 1-> float(-4.6) 89 ...with precision -> float(-5) 105 ...with precision -> float(12300) 168 ...with precision 1-> float(1.2) [all …]
|
H A D | round_modes_zeros.phpt | 33 precision: -1 39 precision: 0 45 precision: 1 51 precision: 2 64 precision: 0 70 precision: 1 76 precision: 2 89 precision: 0 95 precision: 1 101 precision: 2 [all …]
|
/PHP-8.4/ext/bcmath/tests/number/methods/ |
H A D | round_has_trailing_zeros.phpt | 14 ] as [$value, $precision]) { 18 $output .= "precision is {$precision}: "; 27 value is 0.00 , precision is 1: 0.0 30 value is 1.995 , precision is 2: 2.00 33 value is 0.00 , precision is 1: 0.0 36 value is 1.995 , precision is 2: 1.99 39 value is 0.00 , precision is 1: 0.0 42 value is 1.995 , precision is 2: 2.00 45 value is 0.00 , precision is 1: 0.0 51 value is 0.00 , precision is 1: 0.0 [all …]
|
/PHP-8.4/ext/bcmath/libbcmath/src/ |
H A D | round.c | 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() 74 if (UNEXPECTED(precision == ZEND_LONG_MIN)) { in bc_round() 77 *result = bc_new_num(-precision + 1, 0); in bc_round() 85 if (precision >= 0 && num->n_scale <= precision) { in bc_round() 86 if (num->n_scale == precision) { 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() 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()
|
/PHP-8.4/tests/basic/ |
H A D | precision.phpt | 2 precision setting test 4 precision=14 11 ini_set('precision', -1); 13 echo ini_get('precision'), PHP_EOL; 22 ini_set('precision', 0); 24 echo ini_get('precision'), PHP_EOL; 32 ini_set('precision', 9); 42 ini_set('precision', 14); 52 ini_set('precision', 17); 62 ini_set('precision', 25); [all …]
|
/PHP-8.4/ext/bcmath/tests/ |
H A D | bcround_test_helper.inc | 5 foreach ($cases as [$num, $precision]) { 6 …echo str_pad("[{$num}, {$precision}]", 17, ' ', STR_PAD_LEFT), " => ", bcround($num, $precision, $… 103 echo "========== minus precision ==========\n"; 106 echo "========== zero precision ==========\n"; 109 echo "========== plus precision ==========\n";
|
H A D | bcround_early_return.phpt | 30 foreach ($early_return_cases as [$num, $precision]) { 31 …$result = str_pad("[{$num}, {$precision}]", 33, ' ', STR_PAD_LEFT) . ' => ' . bcround($num, $preci… 40 foreach ($early_return_cases as [$num, $precision]) { 41 …$result = str_pad("[{$num}, {$precision}]", 33, ' ', STR_PAD_LEFT) . ' => ' . bcround($num, $preci…
|
H A D | bcround_toward_zero.phpt | 29 ========== minus precision ========== 48 ========== zero precision ========== 68 ========== plus precision ==========
|
H A D | bcround_floor.phpt | 29 ========== minus precision ========== 48 ========== zero precision ========== 68 ========== plus precision ==========
|
H A D | bcround_half_down.phpt | 29 ========== minus precision ========== 48 ========== zero precision ========== 68 ========== plus precision ==========
|
H A D | bcround_half_even.phpt | 29 ========== minus precision ========== 48 ========== zero precision ========== 68 ========== plus precision ==========
|
H A D | bcround_half_odd.phpt | 29 ========== minus precision ========== 48 ========== zero precision ========== 68 ========== plus precision ==========
|
H A D | bcround_half_up.phpt | 29 ========== minus precision ========== 48 ========== zero precision ========== 68 ========== plus precision ==========
|
H A D | bcround_away_from_zero.phpt | 29 ========== minus precision ========== 48 ========== zero precision ========== 68 ========== plus precision ==========
|
/PHP-8.4/Zend/tests/float_to_int/ |
H A D | warnings_string_float_vars.phpt | 77 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 80 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 83 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 86 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 89 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 92 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 95 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 98 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 101 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 105 Deprecated: Implicit conversion from float-string "6.5" to int loses precision in %s on line %d [all …]
|
H A D | warnings_string_float_literals.phpt | 57 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 60 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 63 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 66 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 69 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 72 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 75 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 79 Deprecated: Implicit conversion from float-string "6.5" to int loses precision in %s on line %d 82 Deprecated: Implicit conversion from float-string "2.5" to int loses precision in %s on line %d 86 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d [all …]
|
H A D | warnings_float_literals.phpt | 74 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 77 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 80 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 83 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 86 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 89 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 92 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 95 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 99 Deprecated: Implicit conversion from float 6.5 to int loses precision in %s on line %d 102 Deprecated: Implicit conversion from float 2.5 to int loses precision in %s on line %d [all …]
|
H A D | warnings_float_vars.phpt | 96 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 99 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 102 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 105 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 108 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 111 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 114 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 117 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 120 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 123 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d [all …]
|
H A D | warnings_float_literals_assignment_ops.phpt | 37 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 40 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 43 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 46 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 49 Deprecated: Implicit conversion from float 1.5 to int loses precision in %s on line %d 53 Deprecated: Implicit conversion from float 2.5 to int loses precision in %s on line %d
|
H A D | warnings_string_float_literals_assignment_ops.phpt | 37 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 40 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 43 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 46 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 49 Deprecated: Implicit conversion from float-string "1.5" to int loses precision in %s on line %d 53 Deprecated: Implicit conversion from float-string "2.5" to int loses precision in %s on line %d
|
/PHP-8.4/ext/bcmath/tests/number/operators/ |
H A D | calc_float.phpt | 17 Deprecated: Implicit conversion from float 1.01 to int loses precision in %s 19 Deprecated: Implicit conversion from float 1.01 to int loses precision in %s 21 Deprecated: Implicit conversion from float 1.01 to int loses precision in %s 23 Deprecated: Implicit conversion from float 1.01 to int loses precision in %s 25 Deprecated: Implicit conversion from float 1.01 to int loses precision in %s 27 Deprecated: Implicit conversion from float 1.01 to int loses precision in %s
|
/PHP-8.4/main/ |
H A D | spprintf.c | 187 int precision = 0; in xbuf_format_converter() local 279 STR_TO_DEC(fmt, precision); in xbuf_format_converter() 281 precision = va_arg(ap, int); in xbuf_format_converter() 283 if (precision < -1) in xbuf_format_converter() 284 precision = -1; in xbuf_format_converter() 286 precision = 0; in xbuf_format_converter() 370 s_len = precision; in xbuf_format_converter() 379 s_len = precision; in xbuf_format_converter() 641 precision = FLOAT_DIGITS; in xbuf_format_converter() 642 else if (precision == 0) in xbuf_format_converter() [all …]
|
H A D | snprintf.c | 278 if (precision >= NDIG - 1) { in php_conv_fp() 279 precision = NDIG - 2; in php_conv_fp() 302 if (precision > 0) { in php_conv_fp() 326 if (precision > 0 || add_dp) { in php_conv_fp() 484 int precision = 0; in format_converter() local 583 if (precision < -1) in format_converter() 584 precision = -1; in format_converter() 586 precision = 0; in format_converter() 670 s_len = precision; in format_converter() 846 s_len = precision; in format_converter() [all …]
|