wimal Posted April 7, 2015 Share Posted April 7, 2015 Check the value of A is between value of B and C or not How can do this with lisp. Quote Link to comment Share on other sites More sharing options...
pBe Posted April 7, 2015 Share Posted April 7, 2015 (< b a c) or if equal/between b or c (<= b a c) Quote Link to comment Share on other sites More sharing options...
wimal Posted April 7, 2015 Author Share Posted April 7, 2015 Thanks for quick reply.But some time b>c and it may be b Just I want to find out weather a is between b and c or not. Quote Link to comment Share on other sites More sharing options...
pBe Posted April 7, 2015 Share Posted April 7, 2015 Thanks for quick reply.But some time b>c and it may be bJust I want to find out weather a is between b and c or not. Use the function OR (or (< B A C) (< C A B)) Quote Link to comment Share on other sites More sharing options...
wimal Posted April 7, 2015 Author Share Posted April 7, 2015 ok thanks it is very convenience. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 7, 2015 Share Posted April 7, 2015 I would also likely use or, but just for variation: (< (min b c) a (max b c)) Quote Link to comment Share on other sites More sharing options...
wimal Posted April 9, 2015 Author Share Posted April 9, 2015 thanks Mr Mac you are always thinking to variation. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 9, 2015 Share Posted April 9, 2015 You're welcome - there are usually many ways to skin a cat 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.