Aftertouch Posted July 14, 2017 Share Posted July 14, 2017 Hello all, How can i check if a number is a mutiple of another number.... Like.. (Setq test 18) (Setq checknumber 6) (If (= test *multiple of* checknumber) Return a true, since 18 is a multiple of 6?? Thanks in advance! ;-) Quote Link to comment Share on other sites More sharing options...
handasa Posted July 14, 2017 Share Posted July 14, 2017 (setq test 18) (setq checknumber 6) (if (= (fix (/ test checknumber)) (/ test checknumber)) (alert (rtos (/ test checknumber) 2 0))) Quote Link to comment Share on other sites More sharing options...
tombu Posted July 14, 2017 Share Posted July 14, 2017 (=(*(/ test checknumber)checknumber) test) should work for integers. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted July 14, 2017 Share Posted July 14, 2017 (zerop (rem 18 6)) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.