Message 1 of 9
Division by Integer
Not applicable
02-18-2016
11:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Being a relative newcomer to lisp, I didn't know some of the basic flaws in the lisp language. I've just been writing a piece of code that needed the inverse of a number within it. Pretty simple I thought. But:
(/ 1 20) Returns 0
However turn the number unnecessarily into a real number then it works just fine:
(/ 1 20.0) or (/ 1 (float 20)) Return 0.05
Undoubtedly experianced lispers all know this but it doesn't exactly jump off the page of the 'AutoLISP Functions By Name' site. In fact it says:
(/ [number number ...])
number
Type: Integer or Real
Why doesn't division by integer work in lisp? Why hasn't AutoDesk fixed this basic mathematical function that even an early 1970's LED calculator was capable of?
Are there any other daft shortcomings within lisp thst anybody knows of?
Rant over