I am a little bit intrigued by the way some glib functions such as "g_ascii_dtostr" (and the GKeyFile functions using doubles) work.
Consider this line:
gchar buf[30];
g_message("Double: %f, as String: %s", 0.2, g_ascii_dtostr(buf, 30, 0.2));
Which outputs
Double: 0.200000, as String: 0.20000000000000001
(The weird conversion only happens when I set the buffer size high enough though)
Similar things happen when I (for example) store the double "1.9" in a GKeyFile, but in the resulting file it is saved as "1.8999999999999999". Apparently the conversion back through "g_ascii_strtod" is supposed to be lossless, but it still bothers me why this weirdness happens in the first place. Also this makes my config key-value files pretty ugly..
I think I have read somewhere once that an intermediate "long double" type is used, but this still wouldn't clarify why the converted value is "dirty", because e.g. a conversion from int to double for doesn't have any similar effects I think.