PHP 5 Recipes A Problem-Solution Approach PHẦN 3

. Niềm tin là không một cái gì đó người sử dụng dễ dàng nên cho đi. Tin tưởng nên kiếm được. Bằng cách mở rộng sự tin tưởng thông qua giấy chứng nhận kỹ thuật số và bảo đảm an ninh khác cho người sử dụng các trang web này | 114 3-6 MATH LIBRARIES How It Works Two floating-point values are defined and added with the bcadd function using the default scale 3 set by a call to bcscae . Then the same two values are added but this time the default scale is overwritten by the third argument. Note how the result is truncated and not rounded. The GMP extension implements a long list of functions see Table 3-8 that can be used to manipulate large integer values more than 32 bits . Table 3-8. GMP Functions Name Description gmp_abs gmp_add gmp_and gmp_clrbit Calculates absolute value Adds numbers Logical and Clears bit gmp_cmp Compares numbers gmp_com gmp_div_q gmp_div_qr gmp_div_r gmp_div gmp_divexact gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_init gmp_intval gmp_invert gmp_jacobi gmp_legendre gmp_mod gmp_mul Calculates one s complement Divides numbers Divides numbers and gets quotient and remainder Remainder of the division of numbers Alias of gmp_div_q Exact division of numbers Factorial Calculates GCD Calculates GCD and multipliers Hamming distance Creates GMP number Converts GMP number to integer Inverse by modulo Jacobi symbol Legendre symbol Modulo operation Multiplies numbers gmp_neg Negates number gmp_or gmp_perfect_square gmp_popcount Logical or Perfect square check Population count 3-6 MATH LIBRARIES 115 Name Description gmp_pow Raises number into power gmp_powm Raises number into power with modulo gmp_prob_prime Checks if number is probably prime gmp_random Random number gmp_scan0 Scans for 0 gmp_scan1 Scans for 1 gmp_setbit Sets bit gmp_sign Sign of number gmp_sqrt Calculates square root gmp_sqrtrem Square root with remainder gmp_strval Converts GMP number to string gmp_sub Subtracts numbers gmp_xor Logical xor The following is an alternative to base_convert that works on integers up to 32-bit. The Code php Example if extension_loaded gmp dl use gmp library to convert base. gmp will convert numbers 32bit function gmp_convert num base_a base_b return .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
9    64    2    22-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.