From: Joel VanderWerf Date: 2009-04-29T05:59:11+09:00 Subject: Re: Detecting -0.0 Sebastian Hungerecker wrote: > Joel VanderWerf wrote: >> Oops. That never seemed right to me. Float#equal? should hide the fact >> that floats are allocated, and not immediate. > > Why would it? It doesn't do it for any other type of object. And if it would, > what would be the difference to == ? Because it is only a quirk of cpu architecture that forces them to be allocated rather than immediate. Maybe some future ruby implementation (on >32 bit systems) will use immediate double-precision floats. Other types will never be immediate. The difference to #== would be the same as today: #== performs numeric type conversions (and consequently erases the difference between 0.0 and -0.0). But #equal? never would. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407