gmp_divexact

(PHP 4 >= 4.0.4, PHP 5)

gmp_divexactExact division of numbers

說明

GMP gmp_divexact ( GMP $n , GMP $d )

Divides n by d, using fast "exact division" algorithm. This function produces correct results only when it is known in advance that d divides n.

參數

n

The number being divided.

可以是一個 GMP 數據 resouce,或一個可以轉換為數值的字串。

d

The number that a is being divided by.

可以是一個 GMP 數據 resouce,或一個可以轉換為數值的字串。

回傳值

GMP 數值資源.

範例

Example #1 gmp_divexact() example

<?php
$div1 
gmp_divexact("10""2");
echo 
gmp_strval($div1) . "\n";

$div2 gmp_divexact("10""3"); // bogus result
echo gmp_strval($div2) . "\n";
?>

上例將輸出:

5
2863311534

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top