Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: gmp_div_r - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

gmp_div" width="11" height="7"/> <gmp_div_qr
Last updated: Mon, 05 Feb 2007

view this page in

gmp_div_r

(PHP 4 >= 4.0.4, PHP 5)

gmp_div_r — 除算の余りを計算する

説明

resource gmp_div_r ( resource n, resource d [, int round] )

nd で整数として 割った際の余りを計算します。余りは、引数 n がゼロでないばあいに、これと同じ符号を有します。

例 732. gmp_div_r() の例

<?php
$div
= gmp_div_r("105", "20");
echo
gmp_strval($div) . "\n";
?>

上のプログラムの出力は以下のようになります。


5

     

引数 round の説明については、関数 gmp_div_q() を参照ください。

gmp_div_q()gmp_div_qr() も参照ください。



add a note add a note User Contributed Notes
gmp_div_r
Armando
25-Jan-2006 03:56
A good function to help to find if a number is odd or pair.

function is_odd($tmpnumber){

       if ($tmpnumber < '0') $tmpnumber = gmp_mod($tmpnumber);
       if ($tmpnumber == '0') return(false);
       elseif ($tmpnumber == '1') return(true);
       elseif ($tmpnumber > '1'){
   if (gmp_div_q($tmpnumber,'2') != '0') return(true);
   else return(false);
   }
}

gmp_div" width="11" height="7"/> <gmp_div_qr
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites