Send feedback on this topic.
Teradata.Client.Provider
IsPositive Property (TdNumber)
Example 



Teradata.Client.Provider Namespace > TdNumber Structure : IsPositive Property
Indicates whether this TdNumber instance is greater than or equal to zero.
Syntax
'Declaration
 
Public ReadOnly Property IsPositive As Boolean
'Usage
 
Dim instance As TdNumber
Dim value As Boolean
 
value = instance.IsPositive
public bool IsPositive {get;}
public:
property bool IsPositive {
   bool get();
}

Property Value

true if this instance is greater than or equal to zero; false otherwise.
Remarks
IsPositive returns false if this instance is Null.
Example
This example show how to check for positive and negative numbers.
TdNumber x = new TdNumber(-1);
            
if (x.IsPositive == true)
{   
    Console.WriteLine("x is a positive number.");
}
else
{
    if (x.IsNull == false)
    {
        Console.WriteLine("x is a negative number.");
    }
    else
    {
        Console.WriteLine("x is Null");
    }
}
Requirements
ProductVersionsPlatforms
.NET6, 7Windows, Linux, MacOS
.NET Framework4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdNumber Structure
TdNumber Members