chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Some random thoughts about calculations with base-N


From: Peter Bex
Subject: Re: [Chicken-users] Some random thoughts about calculations with base-N numbers
Date: Sun, 22 Dec 2013 17:00:40 +0100
User-agent: Mutt/1.4.2.3i

On Sun, Dec 22, 2013 at 04:42:36PM +0100, address@hidden wrote:
> You are right - it does not make much sense to work wuch such calculation. I
> was asking the question because I did not have any other idea how to store
> base36 characters for computation other than string - except with 
> vectors/lists
> maybe.

u8vectors would probably be the fastest, but with an overhead of 2
bits per digit because 36 can be represented in 6 bits.  There are
always 2 unused bits for every octet.  The same is true for string
representation.

If you use regular vectors or lists storing one digit in each slot,
the overhead would depend on the platform: on a 32-bit platform
you'd be wasting 24 bits (only 30 bits are used for actual number
representation), on a 64-bit platform that would be 56 bits.

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]