From: Yukihiro Matsumoto Date: 2006-07-10T08:52:24+09:00 Subject: Re: Marshal's handling of floats Hi, In message "Re: Marshal's handling of floats" on Sun, 9 Jul 2006 13:31:59 +0900, Brian Palmer writes: |I was thinking about writing a patch to modify how Marshal handles |floats, right now it dumps them using sprintf(3) and stores the |resulting string in the Marshal stream. I'd like to see it handle |floats the same way that Array#pack does: | |[400.53].pack('g').length == 4 |[400.53].pack('G').length == 8 | |while | |Marshal.dump(400.53).length - 3 == 22 |(and is slower, to boot) | |I want to make sure, though, that this would be an acceptable patch. There are issues: * pack('g') would not work on non-IEEE floating machines. * changing marshal format in incompatible way causes a lot of troubles, so that it should be avoided if possible. I think we can merge it for 1.9 (if we address IEEE754 issue). matz.