• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dividing into two variables

 
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
Marshal
Pie
Posts: 24211
35
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