[#BloombergLP-bdldfp-DecimalImpUtil_IntelDfp-add-0b9]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp.adoc[DecimalImpUtil&lowbar;IntelDfp]::add
:relfileprefix: ../../../
:mrdocs:

Return the IEEE&hyphen;754 sum of two decimal values&period;

== Synopsis

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

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

== Description

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

&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 infinities of differing signs, store the value of the macro `EDOM` into `errno` and return a NaN&period; &ast; Otherwise if `lhs` and `rhs` are infinities of the same sign then return infinity of that sign&period; &ast; Otherwise if `rhs` is zero (positive or negative), return `lhs`&period; &ast; Otherwise if the sum of `lhs` and `rhs` has an absolute value that is larger than max value supported by indicated 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 return the sum of the number represented by `lhs` and the number represented by `rhs`&period;

== Return Value

sum of `lhs` and `rhs`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *lhs*
| left&hyphen;hand decimal operand
| *rhs*
| right&hyphen;hand decimal operand
|===


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