aloy Posted July 22, 2012 Posted July 22, 2012 (edited) Finding the divisibility of a number by another is possible in other languages (like Java and C#). Is it possible in Lisp too?. I shall be thankful for any help. Edited July 22, 2012 by aloy Quote
BlackBox Posted July 22, 2012 Posted July 22, 2012 There are a few ways to go about this, but LISP does not have many of the same Methods .NET languages do... Unless one code their own LispFunction Method and NETLOADs the resultant assembly. But we'll leave that for another thread. One way, would be to convert the real to a string with RTOS, then to split the string into the suffix (right of decimal) using vl-String-Left-Trim and vl-String-Search, then convert that sub-string to a real again (you may need to STRCAT a preceding zero?). HTH Quote
MSasu Posted July 22, 2012 Posted July 22, 2012 Wouldn’t that be the REM built-in function? (rem 5 3) ;return 2 Is that was what you were looking for? Or did I missed something in your request? Quote
aloy Posted July 22, 2012 Author Posted July 22, 2012 Yes Msasu, thats the one. I actually wanted to go through a list which contains chainages, the X and Y coordinates attached to each chainage on a road centre line. The goal is to prepare a table giving the chainages in a column and indicate X and Y values against them in the table. I want to put a remark in another column when the remainder after division of chainage by spacing of chainages (25 or 20 as the case may be) is not zero. I will post another thread about this table later. Thanks Quote
aloy Posted July 22, 2012 Author Posted July 22, 2012 Thanks RenderMan, The reply from MSasu can be used for my purpose. I actually did something like what you mentioned in your second para when I wanted to prepare a table giving chainages, X and Y values attached to variables. That was way back in early 90s. Regards, Aloy Quote
BlackBox Posted July 22, 2012 Posted July 22, 2012 Wouldn’t that be the REM built-in function? Thanks for reminding me of this, Mircea (I forgot all about it! LoL). 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.