[plt-scheme] Bounded number representations

From: Gordon Weakliem (gweakliem at oddpost.com)
Date: Tue Aug 17 14:06:55 EDT 2004

You might be thinking of this thread last month: http://list.cs.brown.edu/pipermail/plt-scheme/2004-July/006100.html 
  
Jens Axel Søgaard has an MD5 implementation at http://scheme.dk/md5/ which contains a bunch of 32 bit integer primitives that might be a place to start. 
  
On a related note, I was wondering if there's a way to determine the size of a fixnum on a Scheme implementation.  It seems like there's no defined way to tell, some Schemes do have a fixnum? predicate.  
-- 
Gordon Weakliem 
http://www.eighty-twenty.net 
  
  
-----Original Message from Matthew Jadud <mcj4 at kent.ac.uk>-----
  
For list-related administrative tasks: 
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme 

I think something like this may have been asked a while back, but I 
don't remember anything coming of it. 

I want to operate on (16/32/64)-bit numbers as if they were represented 
by a native C 'int'. Bigloo doesn't even help in this regard, as the 
most I can squeeze out of Bigloo is 2^30 bits; I really would like to 
have a full 32-bit integer. No more, no less. And ideally, I would get 
C's behavior when I 'overflow' this int. 

What would be the smart way to do this in PLT Scheme? Or, has anyone 
done this already? Or, have I missed the boat on something here? 

I have a sinking feeling it means implementing a number type and all the 
operations on that type. 

Thanks, 
Matt


Posted on the users mailing list.