[plt-scheme] Bounded number representations

From: Matthew Jadud (mcj4 at kent.ac.uk)
Date: Tue Aug 17 11:58:33 EDT 2004

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.


Posted on the users mailing list.