From: Brent Roman Date: 2008-12-06T10:17:52+09:00 Subject: [ruby-core:20396] Re: Leave my open classes alone (was Behavior: autoload calls rb_require() directly) Paul, I understand your concern, but it may not be an tricky as you believe. I think the MagLev folks addressed this by truncating the binary exponent to 8 bits in their immediate object format while always preserving the full mantissa. There should thus be no loss of precision, but there will be a loss of dynamic range. Those few floats whose absolute value is greater than approx. 2**127 (1.0e+38) could not be represented as SmallFloats, so they would be automatically promoted to non-immediate Float objects, much like 2**30 gets silently promoted to a Bignum in 32-bit MRI today. - brent Paul Brannan wrote: > > On Sat, Dec 06, 2008 at 04:46:36AM +0900, Brent Roman wrote: > > You can't easily do these sorts of tricks with floating point numbers; > it breaks IEEE floating point compatibility. On some platforms you > might be able to get away with breaking out the exponent and dropping a > few bits off it, but you'd want a LOT of unit tests to ensure you don't > introduce a subtle incompatibility. > > Floating point code can be very fragile, and I'd feel much better about > a solution that leaves the floating point number intact. > > Paul > > > > -- View this message in context: http://www.nabble.com/-ruby-core%3A20190--Behavior%3A-autoload-calls-rb_require%28%29-directly-tp20777164p20865593.html Sent from the ruby-core mailing list archive at Nabble.com.