Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dividing into two variables  RSS feed

 
Peter Shipway
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey yo all me again
Is they a way to / a number into two differnt variables with the quoteint in one and the reminder in the other? eg.
10 / 4 = 2.5
x = 2
y = 5
Thanks much for any help.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "/" operator will give you the quotient; the "%" operator will give you the remainder (not a fraction, but the actual remainder.) SO you can do this with two operations.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!