## GoLang gmp_div_qr

request it (161)
GoLang replacement for PHP's gmp_div_qr [edit | history]

Do you know a GoLang replacement for PHP's gmp_div_qr? Write it!

## PHP gmp_div_qr

PHP original manual for gmp_div_qr [ show | php.net ]

# gmp_div_qr

(PHP 4 >= 4.0.4, PHP 5, PHP 7)

gmp_div_qrDivide numbers and get quotient and remainder

### Description

array gmp_div_qr ( GMP `\$n` , GMP `\$d` [, int `\$round` = GMP_ROUND_ZERO ] )

The function divides `n` by `d`.

### Parameters

`n`

The number being divided.

Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.

`d`

The number that `n` is being divided by.

Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.

`round`

See the gmp_div_q() function for description of the `round` argument.

### Return Values

Returns an array, with the first element being [n/d] (the integer result of the division) and the second being (n - [n/d] * d) (the remainder of the division).

### Examples

Example #1 Division of GMP numbers

``` <?php\$a = gmp_init("0x41682179fbf5");\$res = gmp_div_qr(\$a, "0xDEFE75");printf("Result is: q - %s, r - %s",       gmp_strval(\$res), gmp_strval(\$res));?> ```
{"ft_lang_label":"__label__en","ft_lang_prob":0.64146894,"math_prob":0.91082877,"size":576,"snap":"2021-43-2021-49","text_gpt3_token_len":169,"char_repetition_ratio":0.12062937,"word_repetition_ratio":0.0,"special_character_ratio":0.27083334,"punctuation_ratio":0.072164945,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9810329,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-12-04T15:57:48Z\",\"WARC-Record-ID\":\"<urn:uuid:f86d9878-f588-4c7b-bbfb-96085c4bef60>\",\"Content-Length\":\"11670\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:db562feb-f547-44f2-b436-2aae33fc94c8>\",\"WARC-Concurrent-To\":\"<urn:uuid:cc236c3e-a899-462e-b684-7c9848d84c2a>\",\"WARC-IP-Address\":\"104.21.12.30\",\"WARC-Target-URI\":\"https://php2golang.com/method/function.gmp-div-qr.html\",\"WARC-Payload-Digest\":\"sha1:OA2C5V6RNMX6LJ2RNCM5PSQWCS7QT6J7\",\"WARC-Block-Digest\":\"sha1:P5TL6Q65BN7IKZA5TLGCIVX26BAV4RHQ\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964362999.66_warc_CC-MAIN-20211204154554-20211204184554-00085.warc.gz\"}"}