After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 322837 - Precision problems when storing doubles
Precision problems when storing doubles
Status: RESOLVED WONTFIX
Product: GConf
Classification: Deprecated
Component: gconf
2.12.x
Other Linux
: Normal major
: ---
Assigned To: GConf Maintainers
GConf Maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2005-11-30 13:25 UTC by Jorn Baayen
Modified: 2018-08-17 13:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch: fixes the problem for me. (688 bytes, patch)
2005-12-08 11:46 UTC, Jorn Baayen
needs-work Details | Review

Description Jorn Baayen 2005-11-30 13:25:55 UTC
The following code fails, whereas I guess it ought to work:

#include <gconf/gconf-client.h>

int
main (int argc, char **argv)
{
        GConfClient *client;
        double a, b;

        a = 10.0 / 3.0;
        g_print ("a: %lf\n", a);

        client = gconf_client_get_default ();
        gconf_client_set_float (client, "/apps/test/float", a, NULL);
        b = gconf_client_get_float (client, "/apps/test/float", NULL);
        g_print ("b: %lf\n", b);

        g_assert (a == b);

        return 0;
}
Comment 1 Jorn Baayen 2005-11-30 13:29:18 UTC
Testing with gconf_string_to_double() and gconf_double_to_string() there are no
problems, so I'm guessing the problem is in orbit somewhere.
Comment 2 Jorn Baayen 2005-12-08 11:07:21 UTC
Note that this works fine using the DBus port of GConf.
Comment 3 Jorn Baayen 2005-12-08 11:46:47 UTC
Created attachment 55775 [details] [review]
Patch: fixes the problem for me.
Comment 4 Mark McLoughlin 2005-12-09 09:57:47 UTC
I don't think we can do that, though - it changes the CORBA interface incompatibly.

i.e. we need to keep "1.4 lib <-> 2.14 daemon" and "2.12 lib <-> 2.14 daemon"
and "2.14 lib <-> 2.12 daemon" etc. working

I guess we could have a ConfigValue2, a ConfigListener2 and a ConfigDatabase4
where ConfigDatabase4 contains ConfigValue2 versions of all methods which use
ConfigValue ... but that's a lot of work to fix this.

Looks this just gets fixed with the switch to D-BUS.
Comment 5 André Klapper 2018-08-17 13:57:19 UTC
GConf has been deprecated since 2011.

GConf is not under active development anymore. Its codebase has been archived:
https://gitlab.gnome.org/Archive/gconf/commits/master

dconf and gsettings are its successors. See https://developer.gnome.org/gio/stable/ch34.html and https://developer.gnome.org/GSettings/ for porting info.

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent + supported version of dconf/gsettings. Thanks!