LibertyOne Posted April 27, 2011 Posted April 27, 2011 There's probably many more ways to do it... (defun oddp ( n ) (and (member (rem n 10) '(1 3 5 7 9)))) But that won't work for a negative integer... Besides, I'm more into keeping it short and simple. And the bitwise calculation you did was impressive! Quote
Lee Mac Posted April 27, 2011 Posted April 27, 2011 Ah yes, needs an abs in there (rem (abs n) 10) - just trying to think a little outside the box Quote
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.