Number isNegative Property



This property returns a Boolean value true if the number is a negative number.

Syntax

num.isNegative 

Example

void main() { 
   int posNum = 10; 
   int negNum = -10; 
   
   print(posNum.isNegative); 
   print(negNum.isNegative); 
} 

It will produce the following output

false 
true
dart_programming_numbers.htm
Advertisements