File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Customer Requirements for Developers
this week in the
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 agree. 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