In article <Pine.LNX.3.96.1010319225134.15108F-100000 / relayer>,
 Mathieu Bouchard <matju / sympatico.ca> wrote:

> On Mon, 19 Mar 2001, Jean-Sebastien ROY wrote:
> > My first reaction was : Could Ruby store the floats like it stores the 
> > integers ?
> > I then read a bit of the ruby source code and besides reducing the size 
> > of the fixnum intergers, it does not seem possible.
> 
> If Fixnums were constrained to the -2**29..(2**29-1) range, it would
> be possible to hold 30-bit floats in a reference. However Ruby's standard
> Floats are 64-bit (though each held in a 160-bit box), and
> single-precision floats (like C's) are 32-bit.

There is a single precision float class in Ruby ?

> Downsizing to 30-bit using a trick like f(float x);  return
> *((unsigned*)&x)>>2;} (or whatever) is still feasible, but it remains that
> a ruby Float is assumed to be 64-bit, and unlike for Fixnums, this is a
> change in semantics.

Unless a new class of floats is defined, maybe ? (with a specific way to 
create them). Like VisualWorks (smalltalk) for example, which has two 
kind of floats (Double and Float).

For some kind of floating point intensive calculations that do not 
require much precision (exactly what I need ;-), it may improve the 
speed noticeably. 

js