double is a better then real
Excess precision cause looses in precision when converted to/form decimal representation. Almost all other non D YAML implementations uses double.
@Herringway : I think that's an issue we should address. real is also much slower than double.
Yes, but replacing real with double has different issues. Nodes really shouldn't be using floating point (or other scalar types aside from string) internally.
So should we just keep the string representation and convert on demand ?
How would you construct a Node then when you need to convert another format to YAML?
So should we just keep the string representation and convert on demand ?
Yes. That would keep the conversions to a minimum and allow values not perfectly representable by floating point types to be preserved between saves/loads.
How would you construct a Node then when you need to convert another format to YAML?
It would not be much different than it is now. This may not even need changes to the interface.
Would you convert floating to string to store it in Node?
Would you convert floating to string to store it in Node?
Yes. It would be difficult to write it to the file otherwise.
Mir has precise number printing that produces the minimal prices decimal form of a given floating point number.