Forum und email

gmp_sqrt

(PHP 4 >= 4.0.4, PHP 5)

gmp_sqrt — Calculate square root

설명

resource gmp_sqrt ( resource $a )

Calculates square root of a .

매개변수

a

GMP 수 resource나 수로 변환할 수 있는 문자열일 수 있습니다.

반환값

The integer portion of the square root, as a GMP number.

예제

Example#1 gmp_sqrt() example

<?php
$sqrt1 
gmp_sqrt("9");
$sqrt2 gmp_sqrt("7");
$sqrt3 gmp_sqrt("1524157875019052100");

echo 
gmp_strval($sqrt1) . "\n";
echo 
gmp_strval($sqrt2) . "\n";
echo 
gmp_strval($sqrt3) . "\n";
?>

위 예제의 출력:

3
2
1234567890