unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* locale-dependent number parsing?
@ 2010-04-05 16:56 Linas Vepstas
  2010-04-05 17:19 ` Mike Gran
  2010-04-05 19:26 ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Linas Vepstas @ 2010-04-05 16:56 UTC (permalink / raw)
  To: Guile User

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

I've found the following bug/feature with guile-1.8.7 and would like to
solicit for comments.
Is this a guile bug? What's the proper work-around?

I've got a C program that does a setlocale (LC_ALL, "");   printf ("%f",
0.2000);

In the de_DE.utf8 locale, the result of the print is 0,2000  using a comma,
since
the comma is the "decimal separator" in most European locales. This numeric
string is then passed to scm_eval_string() which pukes on it, because it
does not
recognize 0,2  as a valid number.    This can be confirmed at the guile
command
line interpreter, which pukes on guile> (+ 0,2 0,2)  but works fine on (+
0.2 0.2)
even in the de_DE locale.

Is this really the expected behaviour? Is there a suggested work-around?

--linas

[-- Attachment #2: Type: text/html, Size: 868 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-05 19:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-05 16:56 locale-dependent number parsing? Linas Vepstas
2010-04-05 17:19 ` Mike Gran
2010-04-05 17:56   ` Linas Vepstas
2010-04-05 19:26 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).