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_sqrtrem - Manual
[go: Go Back, main page]

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

search for in the

gmp_strval" width="11" height="7"/> <gmp_sqrt
Last updated: Fri, 19 Feb 2010

view this page in

gmp_sqrtrem

(PHP 4 >= 4.0.4, PHP 5)

gmp_sqrtrem余りつきの平方根

説明

array gmp_sqrtrem ( resource $a )

ある数の平方根を余りつきで計算します。

パラメータ

a

平方根を計算したい数。

GMP 数リソース、 あるいは数値に変換可能な数値形式の文字列。

返り値

最初の要素が a の整数平方根 (gmp_sqrt()も参照ください)、2 番目の要素が余り (すなわち、a と最初の要素の 2 乗の差) であるような配列を返します。

例1 gmp_sqrtrem() の例

<?php
list($sqrt1$sqrt1rem) = gmp_sqrtrem("9");
list(
$sqrt2$sqrt2rem) = gmp_sqrtrem("7");
list(
$sqrt3$sqrt3rem) = gmp_sqrtrem("1048576");

echo 
gmp_strval($sqrt1) . ", " gmp_strval($sqrt1rem) . "\n";
echo 
gmp_strval($sqrt2) . ", " gmp_strval($sqrt2rem) . "\n";
echo 
gmp_strval($sqrt3) . ", " gmp_strval($sqrt3rem) . "\n";
?>

上の例の出力は以下となります。

3, 0
2, 3
1024, 0



add a note add a note User Contributed Notes
gmp_sqrtrem
There are no user contributed notes for this page.

gmp_strval" width="11" height="7"/> <gmp_sqrt
Last updated: Fri, 19 Feb 2010
 
 
show source | credits | sitemap | contact | advertising | mirror sites