A couple of questions:
1. How does XML handle floats?
Not at all, or however you like to. XML can be used to define your own
formats, it just isn't concerned with storing floats per se.
2. How does YAML handle floats?
Human readable decimal "scientific" format. Space inefficient, maybe
slightly inexact, but very portable.
irb(main):002:0> (1.0/3).to_yaml
=> "--- 0.333333333333333\n"
irb(main):006:0> (10.0**20/3).to_yaml
=> "--- 3.33333333333333e+19\n"
3. What is the format of a float when dumped using Marshal?
irb(main):013:0> Marshal.dump(1.0/3)
=> "\004\010f\e0.33333333333333331\000UU"
irb(main):014:0> Marshal.dump(10.0**20/3)
=> "\004\010f\0363.3333333333333332e+19\000\020U"
This could be changed in 1.9, maybe keeping some backwards
compatibilty in Marshal.load for the old format.
My recommendation would be to dump floats as the hexadecimal
representation of IEEE 64-bit formatted numbers. This is "almost
universal" and occupies only 16 bytes. The alternative, dumping them in
decimal in some "scientific" notation, takes more bytes and loses small,
but noticeable, accuracy. Moreover, it does not capture IEEE's "Inf" and
"NaN" values, which are very much part of the semantics and syntax of
modern numeric processing.
Non-IEEE architectures are very much the exception rather than the rule,
and they can be expected to dump IEEE hex and read IEEE hex as a penalty
for not adopting the standard. 
I think that's reasonable. Note that legacy machines don't need to
implement full IEEE operations, just reading and writing.
-Jürgen
···
On Mon, Jul 10, 2006 at 11:26:25AM +0900, M. Edward (Ed) Borasky wrote:
--
The box said it requires Windows 95 or better so I installed Linux