From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/16506 Path: news.gmane.org!not-for-mail From: Dwaddle Newsgroups: gmane.emacs.gnus.user Subject: Strange results Date: Fri, 6 Sep 2013 23:54:12 -0700 (PDT) Message-ID: <73ac625b-72a4-4719-9ca4-e4d5da9e8c0a@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1378562349 13086 80.91.229.3 (7 Sep 2013 13:59:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Sep 2013 13:59:09 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Sep 07 15:59:14 2013 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VIJ2f-0006CE-Tu for gegu-info-gnus-english@m.gmane.org; Sat, 07 Sep 2013 15:59:14 +0200 Original-Received: from localhost ([::1]:42370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIJ2f-0008P9-Kg for gegu-info-gnus-english@m.gmane.org; Sat, 07 Sep 2013 09:59:13 -0400 X-Received: by 10.224.125.68 with SMTP id x4mr4518604qar.4.1378536852380; Fri, 06 Sep 2013 23:54:12 -0700 (PDT) X-Received: by 10.49.70.138 with SMTP id m10mr6579qeu.9.1378536852364; Fri, 06 Sep 2013 23:54:12 -0700 (PDT) Original-Path: usenet.stanford.edu!q10no2826875qai.0!news-out.google.com!p7ni1205qas.0!nntp.google.com!j7no490578qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.gnus Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.72.118.13; posting-account=DYaMngoAAACRrnihFmF-tuarW3cHCQcb Original-NNTP-Posting-Host: 82.72.118.13 User-Agent: G2/1.0 Injection-Date: Sat, 07 Sep 2013 06:54:12 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.gnus:87631 X-Mailman-Approved-At: Sat, 07 Sep 2013 09:59:12 -0400 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:16506 Archived-At: Hi i've been dabbling around in elisp for a while. Made this function The issue is the byte var which 'remembers' the result from a previous calculation. (integer-bin 5) [0 0 0 0 0 1 0 1] (integer-bin 3) [0 0 0 0 0 1 1 1] To beat the critics I know it isn't very clean programmed and a loop would make it al lot shorter (defun integer-bin (dec) "Convert integer to binairy" (setq 8bit [128 64 32 16 8 4 2 1]) (setq byte [0 0 0 0 0 0 0 0]) (if (= 1 (/ dec (aref 8bit 0))) (when (aset byte 0 1) (setq dec (- dec 128)))) (if (< 0 dec) (if (= 1 (/ dec (aref 8bit 1))) (when (aset byte 1 1) (setq dec (- dec 64))))) (if (< 0 dec) (if (= 1 (/ dec (aref 8bit 2))) (when (aset byte 2 1) (setq dec (- dec 32))))) (if (< 0 dec) (if (= 1 (/ dec (aref 8bit 3))) (when (aset byte 3 1) (setq dec (- dec 16))))) (if (< 0 dec) (if (= 1 (/ dec (aref 8bit 4))) (when (aset byte 4 1) (setq dec (- dec 8))))) (if (< 0 dec) (if (= 1 (/ d