This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

division and testing for whole number result  RSS feed

 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about using the modulus (%) operator?
 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh yeah...i forgot about that. thank you.
 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!