[#BN_div]
= BN&lowbar;div
:mrdocs:

Divide `m` by `d,` writing quotient and&sol;or remainder&period;

== Synopsis

Declared in `&lt;openssl&sol;bn&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BN&lowbar;div(
    xref:BIGNUM.adoc[BIGNUM]* dv,
    xref:BIGNUM.adoc[BIGNUM]* rem,
    xref:BIGNUM.adoc[BIGNUM] const* m,
    xref:BIGNUM.adoc[BIGNUM] const* d,
    xref:BN_CTX.adoc[BN&lowbar;CTX]* ctx);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dv*
| Receives the quotient, or NULL if not required&period;
| *rem*
| Receives the remainder, or NULL if not required&period;
| *m*
| Dividend&period;
| *d*
| Divisor (must be non&hyphen;zero)&period;
| *ctx*
| BN&lowbar;CTX scratch space&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
