A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Refactoring for Software Design Smells: Managing Technical Debt
this week in the
OO, Patterns, UML and Refactoring
Java in General
Test for negative long?
Joined: Aug 21, 2002
Feb 27, 2003 11:20:00
How can I
if a long is a negative rather than positive value?
Joined: Dec 04, 2001
Feb 27, 2003 11:37:00
Check to see if the long is less than zero.
long myLong = -5L;
System.out.println(myLong < 0);
Prints "true" if negative.
Prints "false" if positive.
Hope This Helps
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Test for negative long?
Math.round() question for negative numbers
Jiris, Mock 1, Q17
increase in performance for Reverse for loop
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015