我有两个使用相同库的示例应用程序,它们之间的主要区别在于一个使用 qt 而另一个应用程序是控制台应用程序。
在公共库中,我有这个测试代码:
double test = 0.1;
double test2 = atof("2.13134");
double test3 = atof("1,12345");
如果我使用非 qt 应用程序的值是:
test = 0.10000000000001
test2 = 2.1323399999999999998
test3 = 1 // This is the expected result using a ',' as delimitation character
但是使用 qt 应用程序:
test = 0.10000000000001
test2 = 2 // This is not expected!!!
test3 = 1.1234500000000000001
在任何情况下,'atof' 的行为会因为 qt 而发生变化?