Giter VIP home page Giter VIP logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Hello

I think I have same issue with Ubuntu 10.10. For me the problem was that atof 
function in xmlreader.h was returning integer. I don't know much of coding or 
compilers so I just made my own function to return double and now the 
preprocessor is working right.

Original comment by [email protected] on 5 Jan 2011 at 4:44

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Sorry for the late reply, I have been busy during the last few days.

That's a weird behavior you encounter there. I could not reproduce it with any 
computer available to me.

The only thing I can think of right now is that atof might be using your locale 
settings, i.e., use "," instead of "." as a decimal separator. Can you check 
what results you get for "atof( "1.5" )" and "atof( "1,5" )" or whatever your 
local settings might be?

If this can be confirmed I have to replace atof with local-independent routines 
as the OSM input always uses '.' as a separator.

Original comment by [email protected] on 5 Jan 2011 at 8:59

  • Changed state: Accepted
  • Added labels: Priority-High
  • Removed labels: Priority-Medium

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Hello

I did some testing with clean project only main function and cstdlib and 
iostream included. atof returns 1.5 as 1.5 and 1,5 as 1. Then I added 
QApplication to includes and "QApplication app(argc, argv);" to the top of main 
function. Now atof returns 1.5 as 1 and 1,5 as 1.5.

That same happens inside MoNav's code, I think.

Original comment by [email protected] on 6 Jan 2011 at 4:10

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
$ cat foo.c 
#include <stdio.h>
#include <stdlib.h>

int main() {
    printf("1,50 → %.2f\n", atof("1,5"));
    printf("1.50 → %.2f\n", atof("1.5"));
}
$ ./a.out

1,50 → 1.00
1.50 → 1.50
$

It seems it's doing the "right" thing. However, a locale-agnostic 
implementation would be better in any case, I'd say.

Original comment by [email protected] on 9 Jan 2011 at 8:55

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
(so yes, maybe it's something related to QApplication)

Original comment by [email protected] on 9 Jan 2011 at 8:57

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
...and, strange, but yes, my locale has "," as decimal separator:

Compare:

$ df -h | grep sdb
/dev/sdb1             7,4G   20K  7,4G   1% /media/PHOTOSD
$ LANG=C df -h | grep sdb
/dev/sdb1             7.4G   20K  7.4G   1% /media/PHOTOSD

(sorry for the multiple comments)

Original comment by [email protected] on 9 Jan 2011 at 9:12

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Nice piece of investigative work.

Could you try whether r404 fixes the behavior?

Original comment by [email protected] on 9 Jan 2011 at 9:56

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
I couldn't backport it to 0.2, so I checked it out. And yes, it works great :)

When will you release a new version I could package? :)

Thanks!

Original comment by [email protected] on 9 Jan 2011 at 10:43

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Works great! Thank you

Original comment by [email protected] on 9 Jan 2011 at 11:26

from monav.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024

Original comment by [email protected] on 13 Jan 2011 at 11:57

  • Changed state: Fixed

from monav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.