View Single Post
  #1 (permalink)  
Old 07-22-2007, 10:33 PM
zoe zoe is offline
Member
 
Join Date: Jul 2007
Posts: 40
zoe is on a distinguished road
Using int/int, 7/5 would return 1
I'm programming in Java. I'm trying to make a program that inputs money (as a double) and determines the amount of different coins to give.
My problem is, I input a value as a double, and try to divide by a number to get the number of times it goes into that number, and get a remainer.
For example, using int/int, 7/5 would return 1.
But dividing double/double 7.0/5.0 returns an exact double. How to i get int "1" out of that?
Thanks.
Reply With Quote
Sponsored Links