This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes division and testing for whole number result Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "division and testing for whole number result" Watch "division and testing for whole number result" New topic
Author

division and testing for whole number result

Tom Griffith
Ranch Hand

Joined: Aug 06, 2004
Posts: 275
Hello. if anybody has a minute, I was looking for a way to see if one integer divides evenly inot a larger interval (ie. with nothing after the decimal). I was thinking parseInt and catch an exception on it but that doesn't do it. Does anybody have any suggestions? Thank you very much for reading this.
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
How about using the modulus (%) operator?
Tom Griffith
Ranch Hand

Joined: Aug 06, 2004
Posts: 275
oh yeah...i forgot about that. thank you.
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
Cheers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: division and testing for whole number result