Search found 2 matches

by esx_raptor
Sun Apr 11, 2010 8:39 am
Forum: Common Lisp
Topic: Decimal-to-Binary Converter
Replies: 4
Views: 10153

Re: Binary-to-Decimal Function

I have run into the following problem while trying to implement a binary-to-decimal converter: Your problem is that you don't know what "integer", "binary" and "decimal" actually mean. Please first learn the difference between an object (in this case, integers ) and it...
by esx_raptor
Sun Apr 11, 2010 12:17 am
Forum: Common Lisp
Topic: Decimal-to-Binary Converter
Replies: 4
Views: 10153

Decimal-to-Binary Converter

Hey guys! I'm kind of new to LISP and because of this, I have run into the following problem while trying to implement a decimal-to-binary converter: (defun bin (x) (if (eql x 0) 0 (progn (bin (round (/ x 2))) (mod x 2)))) The problem here is that I don't know how to do some sort of "integer co...