Jump to content

Recommended Posts

Posted (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 by aloy
Posted

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

Posted

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?

Posted

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

Posted

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

Posted
Wouldn’t that be the REM built-in function?

 

Thanks for reminding me of this, Mircea (I forgot all about it! LoL).

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...