Skip to content

Weird math issue when embedding to SWI-Prolog #1134

Answered by tatut
tatut asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, this seems to be a locale issue.

 printf("strtod(\"4.2\") == %f\n", strtod("4.2", NULL));
  printf("strtod(\"4,2\") == %f\n", strtod("4,2", NULL));

prints

strtod("4.2") == 4,000000
strtod("4,2") == 4,200000

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@tatut
Comment options

@tatut
Comment options

@tatut
Comment options

@tatut
Comment options

Answer selected by tatut
@tatut
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants