Send feedback on this topic.
Teradata.Client.Provider
Addition Operator (TdNumber)
Example 



Teradata.Client.Provider Namespace > TdNumber Structure : Addition Operator
The operand that appears to the left of the '+' sign.
The operand that appears to the right of the '+' sign.
Calculates the sum of the two TdNumber operands.
Syntax
'Declaration
 
Public Operator +( _
   ByVal left As TdNumber, _
   ByVal right As TdNumber _
) As TdNumber
'Usage
 
public TdNumber operator +( 
   TdNumber left,
   TdNumber right
)
public:
TdNumber operator +( 
   TdNumber left,
   TdNumber right
)

Parameters

left
The operand that appears to the left of the '+' sign.
right
The operand that appears to the right of the '+' sign.

Return Value

A TdNumber containing the sum of the two operands.
Exceptions
ExceptionDescription

The result is not in the range (between TdNumber.MinValue and TdNumber.MaxValue) of a TdNumber, or the exponent is less than -130.

Remarks

If one of the parameter is TdNumber.Null, the result will be TdNumber.Null.

Example
The following example creates pairs of TdNumbers and adds them using the + operator.
// 1  + (-1e-38) = 9.9999999999999999999999999999999999999e-1
TdNumber left01 = new TdNumber(1, 0, 0, 0, 0, 0);      // left01 = 1
TdNumber right01 = 
     new TdNumber(unchecked((Int32)0xFFFFFFFF), 
                   unchecked((Int32)0xFFFFFFFF), 
                   unchecked((Int32)0xFFFFFFFF), 
                   unchecked((Int32)0xFFFFFFFF), 
                   unchecked((Int32)0xFFFFFFFF, -38);  // right01 = -0.00000000000000000000000000000000000001
TdNumber result01 = left01 + right01;
Console.WriteLine("{0} + {1} = {2}", left01, right01, result01);
 
// 3.4538475968734 + (-0.4538475968734) = 3
TdNumber left02 = TdNumber.Parse("3.4538475968734");
TdNumber right02 = TdNumber.Parse("-0.4538475968734");
TdNumber result02 = left02 + right02;
Console.WriteLine("{0} + {1} = {2}", left02, right02, result02);
Requirements

Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2

See Also

Reference

TdNumber Structure
TdNumber Members