gmp_div_q

gmp_div_q【gmp_div_q】gmp_div_q函式,(PHP 4 >= 4.0.4, PHP 5)gmp_div_q — Divide numbers 。resource gmp_div_q ( resource $a , resource $b [, int $round ] )Divides a by b and returns the integer result.
基本介绍外文名:gmp_div_q
类型:函式
gmp_div_q(PHP 4 >= 4.0.4, PHP 5)gmp_div_q -- 数字鸿沟 函式原型及解释resource gmp_div_q ( resource a, resource b [, int round] )除以b,并返回一个整数的结果 。结果四捨五入的定义是圆的,可以有以下值:GMP_ROUND_ZERO:结果是对0截断 。GMP_ROUND_PLUSINF:结果四捨五入向正无穷 。GMP_ROUND_MINUSINF:结果四捨五入朝-无穷远 。此功能也可称为gmp_div() 。例子<?php$div1 = gmp_div_q("100", "5");echo gmp_strval($div1) . "\n";$div2 = gmp_div_q("1", "3");echo gmp_strval($div2) . "\n";$div3 = gmp_div_q("1", "3", GMP_ROUND_PLUSINF);echo gmp_strval($div3) . "\n";$div4 = gmp_div_q("-1", "4", GMP_ROUND_PLUSINF);echo gmp_strval($div4) . "\n";$div5 = gmp_div_q("-1", "4", GMP_ROUND_MINUSINF);echo gmp_strval($div5) . "\n";?>输出200101