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



Teradata.Client.Provider Namespace > TdNumber Structure : Subtraction Operator
The operand that appears to the left of the '-' sign.
The operand that appears to the right of the '-' sign.
Calculates the result of subtracting 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 result of the subtaction between 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 subtracts them using the - operator.
// 1 - 1e-38 = 0.99999999999999999999999999999999999999
TdNumber left01 = new TdNumber(1, 0, 0, 0, 0, 0);      // left01 = 1
TdNumber right01 = new TdNumber(1, 0, 0, 0, 0, -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 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdNumber Structure
TdNumber Members