From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.user Subject: Re: unsigned-int Date: Fri, 23 Jun 2017 08:16:54 -0400 Message-ID: <871sqaj3ux.fsf@netris.org> References: <87efuchu4b.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1498220246 12361 195.159.176.226 (23 Jun 2017 12:17:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Jun 2017 12:17:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: guile-user@gnu.org To: Catonano Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 23 14:17:22 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dONWb-0002yY-V6 for guile-user@m.gmane.org; Fri, 23 Jun 2017 14:17:22 +0200 Original-Received: from localhost ([::1]:35281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dONWh-0007v0-78 for guile-user@m.gmane.org; Fri, 23 Jun 2017 08:17:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dONWI-0007uc-Vk for guile-user@gnu.org; Fri, 23 Jun 2017 08:17:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dONWE-0007zy-UP for guile-user@gnu.org; Fri, 23 Jun 2017 08:17:02 -0400 Original-Received: from world.peace.net ([50.252.239.5]:49111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dONWE-0007zc-Pp for guile-user@gnu.org; Fri, 23 Jun 2017 08:16:58 -0400 Original-Received: from [10.1.10.104] (helo=jojen) by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dONNx-0000pT-Py; Fri, 23 Jun 2017 08:08:25 -0400 In-Reply-To: (catonano@gmail.com's message of "Thu, 22 Jun 2017 21:13:39 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 50.252.239.5 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13874 Archived-At: Catonano writes: > 2017-06-22 18:20 GMT+02:00 Mark H Weaver : > >> Given this, and >> the fact that you're passing the wrong width, makes me surprised that >> this is working for you at all. > > > Mark, thank you so much for your review. I appreciate that > > I apologize if my questions are naive. No, not at all. I appreciate your work on guile-freexl. My surprise that it was working at all was not a judgement of you, rather it was a sincere confusion, but now I understand. The combination of two mistakes: (endianness big) and width 1, actually had the effect of making this work for numbers small enough to fit in 1 byte, which means unsigned numbers between 0 and 255 and signed numbers between -128 and 127. > So, yeah, I'm sorry for the fuss No need to apologize. > All that said, I applied the fixes that you suggested and I still get > completely wrong number of rows of the spreadsheets and correct number of > columns > > Exactly as before your correctons Except that now it will work for larger numbers, and on architectures that are truly big endian, whereas before it wouldn't have. > For now I renounced to extract numbers from my bytevectors > > The culprit is: #vu8(232 3 0 0) > > There are 27 lines in the sheet, so this bytevector should represent 27, > somehow. On a little-endian architecture (which includes Intel and most other popular architectures), #vu8(232 3 0 0) represents 1000. If that's the number you're getting, then that part of the code is working correctly. > On another sheet in the same file, this is what happens: > > (#vu8(118 0 0 0) #vu8(17 0)) > > The sheet has 17 columns indeed. And it has 23 rows :-/ #vu8(118 0 0 0) represents 118. I'm not sure why it's a different number than you're expecting, but I can tell you that's the number in that bytevector. Mark