[#BloombergLP-bdldfp-DecimalImpUtil-divide-05]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil.adoc[DecimalImpUtil]::divide
:relfileprefix: ../../../
:mrdocs:

Divide the value of the specified `lhs` by the value of the specified `rhs` as described by IEEE&hyphen;754, and return the result&period;

== Synopsis

Declared in `&lt;bdldfp&lowbar;decimalimputil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[DecimalImpUtil::ValueType32]
divide(
    xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[ValueType32] lhs,
    xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[ValueType32] rhs);
----

== Description

&ast; If either of `lhs` or `rhs` is signaling NaN, then store the value of the macro `EDOM` into `errno` and return a NaN&period; &ast; Otherwise if either of `lhs` or `rhs` is NaN, return a NaN&period; &ast; Otherwise if `lhs` and `rhs` are both infinity (positive or negative) or both zero (positive or negative) then store the value of the macro `EDOM` into `errno` and return a NaN&period; &ast; Otherwise if `lhs` has a normal value and `rhs` has a positive zero value, store the value of the macro `ERANGE` into `errno` and return infinity with the sign of `lhs`&period; &ast; Otherwise if `lhs` has a normal value and `rhs` has a negative zero value, store the value of the macro `ERANGE` into `errno` and return infinity with the opposite sign as `lhs`&period; &ast; Otherwise if dividing the value of `lhs` by the value of `rhs` results in an absolute value that is larger than the maximum value supported by the result type then store the value of the macro `ERANGE` into `errno` and return infinity with the same sign as that result&period; &ast; Otherwise if dividing the value of `lhs` by the value of `rhs` results in an absolute value that is smaller than min value supported by the indicated result type then store the value of the macro `ERANGE` into `errno`and return zero with the same sign as that result&period; &ast; Otherwise return the result of dividing the value of `lhs` by the value of `rhs`&period; Return the quotient of the specified decimal values&period;


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