aspose file tools*
The moose likes Java in General and the fly likes Test for negative long? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Test for negative long?" Watch "Test for negative long?" New topic
Author

Test for negative long?

myron schabe
Greenhorn

Joined: Aug 21, 2002
Posts: 19
How can I test if a long is a negative rather than positive value?
Rodney Woodruff
Ranch Hand

Joined: Dec 04, 2001
Posts: 80
Check to see if the long is less than zero.
Example
long myLong = -5L;
System.out.println(myLong < 0);
Prints "true" if negative.
Prints "false" if positive.


Hope This Helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Test for negative long?